Bypass XSS filter using HTML Escape
The report describes a bypass of an XSS filter using HTML entity encoding, allowing execution of a script via an onload handler in a style tag. The attacker could run arbitrary JavaScript in the context of the vulnerable site.
Published on medium.com
after all the bugs were fixed, I was still curious and wanted to try again, then I tried the first day and it failed :( because it is blocked by csp I tried using this payload:
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 XSS filter did not properly decode HTML entities before checking for dangerous tags, allowing an encoded payload to bypass the filter.
Impact
An attacker could execute arbitrary JavaScript in the context of the vulnerable site, potentially stealing cookies or performing actions on behalf of the user.
What the attacker needed
Ability to inject HTML into a page
The fix
The report states the issue was fixed, but does not describe the fix.
How it was found
- Try a payload with a noscript tag and a style tag with an onload handler.
- Observe that the payload is blocked by CSP.
- Apply HTML escape encoding to the payload.
- Submit the encoded payload and observe the alert 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.
Cross-site scripting (XSS) is a bug where an attacker can make a website run their JavaScript code. Here, the site tried to block dangerous HTML but the attacker used HTML escape characters (like <) to sneak past the filter and still get code to run.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.