Bypass voting restriction due to HTTP Header Injection
The voting endpoint trusted a client-supplied X-Forwarded-For header to identify the voter's IP address, so the per-IP vote limit could be evaded. An attacker could vote a dictionary entry up or down an unlimited number of times.
- Fixed in 3 months
- Disclosed after 4 months
It is possible to bypass the voting restriction by adding a specially crafted HTTP-Header. The underlying algorithm uses the ip address to restirct the voting of a user. However, by manipulating the IP-Adress via adding the HTTP-Header "X-Forwarded-For" it is possible to vote a entry up or down without any restrictions.
Steps to reproduce:
- Open a dictionary entry.
- Intercept the request of voting the dictionary entry up.
- Send the request to repeater of intruder and add the "X-Forwarded-For <Arbitrary IP>" with an arbitrary ip.
It is possible to use the Burp intruder or write a python script to vote a entry up as ofter you like.
Example request:
POST /v0/vote HTTP/1.1
Host: api.urbandictionary.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0
Accept: application/json, text/javascript, */*; q=0.01
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
X-Forwarded-For: 12.34.56.79
Content-Type: application/json; charset=utf-8
Content-Length: 35
Origin: https://hacker.com
Connection: close
Cookie: _ga=GA1.2.47064909.1583578169; _gid=GA1.2.1544677998.1583578169; _urbandictionary_session2=b356ceb8c5a73a51d46eb41ade3e16bc; __qca=P0-734169870-1583578169821; __gads=ID=22f39fd8c45fa19c:T=1583578173:S=ALNI_MbuqBUhxnFp6bo_iuHQWJAXpAwZww
{"defid":12559865,"direction":"up"}
Impact
An attacker or normal user can vote a entry up unlimited times.
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 used the client-controlled X-Forwarded-For header as the source of the voter's IP address instead of the real connection address.
Impact
An attacker or ordinary user could vote an entry up or down unlimited times, skewing the site's vote counts.
What the attacker needed
A session cookie; ability to intercept HTTP requests
How it was found
- Open a dictionary entry.
- Intercept the request that votes the entry up.
- Resend the request with an X-Forwarded-For header set to an arbitrary IP address.
- Repeat the request, using a tool or a script, to vote as often as desired.
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.
The site tried to stop people voting repeatedly by remembering their IP address, which is a number that identifies a device on the internet. But it believed a value the visitor could set themselves in the request, so anyone could pretend to be a new visitor each time and vote as often as they liked.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.