XSS at error page of repository code
A PHP error page in the program's GitHub repository reflected a GET parameter without sanitisation, allowing an attacker to inject script. If a website integrated that code, it would become vulnerable to reflected XSS.
This article is about a security bug/issue i have found at private program on Hackerone(H1).
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 PHP error page echoed a GET parameter into the HTML response without encoding or validating it.
Impact
Any website that integrated the vulnerable code could be exposed to reflected XSS, though the report only demonstrates the issue in the repository code itself.
What the attacker needed
Access to the public GitHub repository; a victim who visits a crafted link
How it was found
- Search GitHub for the private program's name and find its PHP code.
- Look for GET parameters used in the code.
- Identify a default error page that reads a GET parameter.
- Insert a script payload into that parameter and load the page.
- Observe the alert box showing document.cookie.
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 program published some PHP code on GitHub. One of its pages took a value from the web address and put it straight into the page without cleaning it. That means someone could craft a link that runs their own JavaScript in a visitor's browser, which is called reflected cross-site scripting (XSS).
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.