How I Found a Critical XSS On a Public Bug Bounty Program
An unauthenticated endpoint allowed editing of page content, and a field was rendered without sanitisation, enabling stored XSS. The author chained this with a cloned login page to potentially capture admin credentials.
medium.com
Published on medium.com
The only reconnaissance I did to find this domain was just a simple google dork.
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 accepted unauthenticated edits and inserted the edited content into the page without proper output encoding or sanitisation.
Impact
An attacker could store script that runs for visitors, and by redirecting them to a cloned login page could potentially capture admin credentials, leading to account takeover and router compromise; however, direct cookie theft was blocked by HttpOnly and a specific Path.
What the attacker needed
No authentication needed; victim visits the infected page; attacker controls a server
How it was found
- Find a subdomain via a Google dork and visit the router login portal.
- Run a JavaScript bookmarklet to list endpoints and find /guest/preview.cgi, which exposes an admin page.
- Toggle Edit mode and modify a page element, then save; the change persists.
- Capture the save request to /guest/portal_admin_upload.cgi and note the edit_page JSON field.
- Replace the agree_button value with a script payload and send the request; the response says save success.
- Refresh the page and observe the script executing.
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 stored cross-site scripting (XSS) flaw lets an attacker save malicious code on a website, which then runs in the browsers of people who view that page. Here, anyone could change page text without logging in, and the changed text was not cleaned, so script code could be saved and executed.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.