How a Simple HPP Bug Earned $700 on Twitter
Twitter's unsubscribe link used a signature generated from a UID parameter to validate the request, but when the same UID parameter appeared twice the server checked the signature against one value and performed the unsubscribe against the other. An attacker could therefore unsubscribe another user from notification emails by supplying a second UID.
Published on medium.com
The bug was reported to Twitter back in 2015, and it’s still one of the cleanest examples of HTTP Parameter Pollution I’ve seen.
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
The application validated the signature against one occurrence of the duplicated UID parameter but acted on a different occurrence, so validation and action used inconsistent values.
Impact
An attacker could unsubscribe another user from Twitter notification emails without knowing that user's signature.
What the attacker needed
A valid unsubscribe link with signature; ability to add a duplicate parameter
How it was found
- Open the unsubscribe link from a Twitter notification email, which contains a UID and a signature.
- Try changing the UID to another user's ID and observe that the signature check fails.
- Instead of replacing the UID, add a second UID parameter to the same request.
- Send the request and observe that the signature is checked against the first UID while the unsubscribe is performed for the second UID.
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 web address can carry extra pieces of information called parameters, and some sites trust a signature to prove the request is genuine. Here the site checked the signature against one copy of the user identifier but then acted on a second copy of the same identifier. That mismatch let someone make the site unsubscribe a different account than the one the signature was made for.
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.