Reflected XSS into attribute with angle brackets HTML-encoded �
The search parameter is reflected into an HTML attribute, and although angle brackets are encoded, quotes are not, allowing an attacker to break out of the attribute and inject an event handler that executes JavaScript. This enables reflected XSS, which could lead to session theft or other client-side attacks.
Published on medium.com
The search parameter is echoed into an HTML attribute on the results page. Although < and > are HTML‑encoded, the application fails to escape or validate quotation marks and attribute context.
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 encodes angle brackets but fails to escape quotes or apply attribute-context encoding, allowing an attacker to break out of the attribute value and inject an event handler.
Impact
Reflected JavaScript execution in a victim’s browser could lead to cookie/token theft, CSRF-like actions, UI manipulation, and data exfiltration, delivered via a crafted link.
What the attacker needed
Victim clicks a crafted link; search parameter reflected in attribute
The fix
The application should perform attribute-context encoding, escaping at least &, ", ', <, and >, and use context-aware escaping functions rather than ad-hoc replacements.
How it was found
- Open the lab page and read the description.
- Enter a simple test payload with a double quote to check for encoding or filtering.
- Inspect the page source to see that angle brackets are encoded and input appears inside double quotes of a value attribute.
- Try an event handler payload that closes the attribute and adds an onmouseover handler, which executes and solves the lab.
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.
When you type something into a search box, the website sometimes puts your text directly into the page's code. If the site doesn't clean up special characters like quotes, an attacker can craft a link that makes the page run harmful code in your browser. This is called cross-site scripting (XSS), and it can let an attacker steal your session or trick you into actions.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.