Skip to content
XSS Write-up Intermediate

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.

Syahri Ramadan Follow

Published on medium.com

Bounty$4,134 View original

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:

Syahri Ramadan, on medium.com

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

  1. Try a payload with a noscript tag and a style tag with an onload handler.
  2. Observe that the payload is blocked by CSP.
  3. Apply HTML escape encoding to the payload.
  4. 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.

More by Syahri Ramadan

View all

1 more disclosed report, best first.

More from Google

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.