Skip to content
XSS Write-up Intermediate

T̶A̶X̶ WAF Evasion: Escalating User-Controlled Input to Cross

A shopping-style feature rendered user-controlled item fields without filtering, allowing HTML injection. A WAF blocked common XSS payloads, but crafted payloads bypassed it and triggered JavaScript in a victim's browser when a shared link was opened, leading to an arbitrary redirect.

Qolandar Follow

Published on medium.com

In the realm of website security, XSS is a common issue. XSS occurs when a system renders user input without any filtering whatsoever.

Qolandar, 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 application rendered user-controlled item fields without context-aware output encoding, and the WAF's pattern matching could be bypassed with crafted attributes.

Impact

An attacker could run JavaScript in a victim's browser via a shared link, initially showing an alert and then redirecting the victim to another site; HTTPOnly cookies made account takeover less likely.

What the attacker needed

A feature that renders user-controlled item fields; ability to create and share a link; victim opens the shared link; a browser that supports the chosen event

The fix

The text does not state a fix; it should be fixed by directly encoding user input in the correct output context rather than relying on a WAF.

How it was found

  1. Intercept the add-item request and insert a simple HTML tag to confirm the value is rendered.
  2. Try common XSS payloads and observe that the WAF blocks them.
  3. Use a crafted input-tag payload that bypasses the WAF and renders on the page.
  4. Use a crafted details-tag payload that triggers without user interaction.
  5. Generate and share a link, then trace a 503 error to find events that are not blocked.
  6. Modify the payload with extra attributes so the WAF ignores the event, then confirm the link loads without a 503 and the payload runs on the victim side.

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 website let people type text into item titles and descriptions and then showed that text back on a page without cleaning it. Normally a security filter called a WAF tries to block dangerous text, but the researcher found ways to write the text so the filter missed it. When another user opened a shared link, the hidden code ran in their browser and could send them to a different website.

What is XSS?

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

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.