Reflected XSS via `████████` parameter
A forum subscription page reflected a user-supplied parameter without filtering angle brackets, allowing an attacker to inject an image tag with an error handler. An attacker could run script in a victim's browser to steal cookies because they lacked the HttpOnly flag.
- Triaged in 2 days
- Fixed in 2 months
- Disclosed after 3 months
Hello everyone,
I came across a page that allows users to subscribe to certain forum posts at https://███ I noticed that the ████ parameter is reflected in the Page without filtering dangerous characters such as < > except the = character which is filtered by default, but this can be circumvented by encoding it = ====> %3d , however the precedent page is vulnerable to Reflected XSS:
POST /██████_█████████=1&█████████=test HTTP/1.1
Host: ███
Cookie: █████
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Content-Length: 101
Origin: https://███████
Authorization: Basic ....
Referer: https://███████
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Te: trailers
Connection: close
__Click=0&activeFlag=Y&%25%25Surrogate_██████=1&██████████=<img src%3dx onerror%3dalert(document.domain)>
The above HTTP request leads to an alert pop-up confirming the XSS issue:
█████████
Also the cookies aren't protected by using HttpOnly security flag, so cookies can be grabbed using a simple payload such as <img src=%3d onerror%3dalert(document.cookie):
████
Impact
Cookies theft, Open Redirect, phishing via arbitrary iframes etc..
System Host(s)
██████
Affected Product(s) and Version(s)
CVE Numbers
Steps to Reproduce
- Go to https://██████ (You must be authenticated).
- Click on
Submit, then Intercept the request with Burp Suite, change the█████parameter's value to<img src%3dx onerror%3dalert(document.cookie> - You'll see an alert pop-up showing your logged-in cookies.
Suggested Mitigation/Remediation Actions
sanitizing dangerous characters by returning their equivalent HTML entities (see htmlspecialchars() function in PHP).
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 application reflected the parameter into the HTML response without HTML-encoding angle brackets, and session cookies lacked the HttpOnly attribute.
Impact
An attacker could steal cookies, perform open redirects, or host phishing content in iframes; the report notes cookies were not protected by HttpOnly.
What the attacker needed
Authenticated user
The fix
The report suggests sanitising dangerous characters by converting them to HTML entities, such as with htmlspecialchars() in PHP.
How it was found
- Log in and open the forum subscription page.
- Intercept the submit request and change the vulnerable parameter to an image tag with an error handler.
- Observe the alert pop-up showing the logged-in cookies.
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.
When a website puts text from a request straight into the page without cleaning it, an attacker can include HTML or JavaScript. Here the page accepted an image tag whose error handler ran JavaScript, so the attacker's code executed in the victim's browser. Because the login cookies were readable by JavaScript, the attacker could copy them and take over the session.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.