How I was able to takeover any users account on a major telecoms website
Several user-supplied parameters on a telecoms voucher site reflected input back into the page, and the reflection could be triggered through a POST request that bypassed the WAF's GET-only filtering. An attacker could auto-submit a cross-site form to run script in a victim's browser and steal their session cookie, since the cookie lacked the HTTPOnly flag.
Published on medium.com
Hello, todays write up is about multiple instances of the same vulnerability I found on a major African telecoms providers website, we will call it redacted.
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 application reflected request parameters into the page without output encoding, and the WAF only inspected GET requests so the same parameters sent via POST were not filtered.
Impact
An attacker could run script in an authenticated victim's browser and steal their session cookie, leading to account takeover, because the cookie was not marked HTTPOnly.
What the attacker needed
Victim is logged in; victim visits attacker page; cookie lacks HTTPOnly
The fix
The issue was fixed after being reported.
How it was found
- Send a request with a test value in a parameter and observe it reflected in the page.
- Note that GET requests carrying script payloads are blocked by the WAF.
- Resend the same request as a POST with URL encoding and see the value reflected.
- Move the value from the cookie into a POST body parameter and confirm it is still reflected.
- Build an auto-submitting cross-site form that delivers the POST to the victim.
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.
The site took text from the visitor and pasted it straight back into the page without cleaning it. Normally a filter blocked this when the text arrived in a GET request, but the same text sent as a POST request slipped through. Because the login cookie could be read by scripts, an attacker could trick a logged-in user into loading a page that quietly sent the malicious request and then sent the cookie to the attacker.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.