Bug Bounty: How a Race Condition Led to Application-Level DoS
The document upload feature enforced a three-file limit only on the client side, so sending many upload requests at the same time let an attacker exceed the limit. This could fill server storage and degrade or crash the application.
medium.com
Published on medium.com
Cybersecurity is a constant battle between defenders and attackers. One overlooked flaw can lead to catastrophic results, and today, I am shedding light on a critical vulnerability I discovered on example.com.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the upload limit was checked without an atomic operation or lock, so concurrent requests all passed the check before any of them updated the count.
Impact
An attacker could upload unlimited files, potentially exhausting storage and causing an application-level denial of service; the text does not say whether any defence limited the attack.
What the attacker needed
A user account; ability to intercept HTTP requests
The fix
The upload limit should be enforced on the server with atomic counting or locking, plus rate limiting and monitoring.
How it was found
- Log in and open the documents upload page.
- Capture the upload request with an intercepting proxy and send it to Repeater.
- Duplicate the request several times and group them.
- Send the group in parallel and refresh the page.
- Observe that more than three documents were uploaded.
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 write-up has not been written yet. The Original tab links to the source.
A race condition happens when a program checks a rule and then acts, but many requests arrive in the tiny gap between the check and the action. Here the server checked the upload count but did not stop several uploads happening at once, so the limit was bypassed. An attacker could then upload many files and use up disk space.
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.