Skip to content
XSS Write-up Intermediate

Bypassing an Akamai WAF to Achieve Self-XSS via CSRF Chain

The registration form reflected an unsanitised email value, allowing self-XSS that was blocked by an Akamai WAF. The author bypassed the WAF with an HTML tag and chained a CSRF token cookie endpoint to turn the self-XSS into a one-click attack against other users.

medium.com

Published on medium.com

While casually exploring a web application (later discovered to be behind an Akamai WAF), I came across an interesting behavior during the login and registration flow. What initially looked like a harmless self-XSS opportunity turned into a practical exploit by chaining multiple weak points — bypassing a WAF and…

Kariiem Gamal, 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

Impact

An attacker could execute script in a victim's browser after a single click, potentially exfiltrating sensitive data, though the WAF initially blocked simpler payloads.

What the attacker needed

Victim clicks a link; victim clicks anywhere on the page; WAF bypass payload

The fix

The application should properly sanitise reflected input and avoid exposing CSRF tokens via easily accessible endpoints.

How it was found

  1. Enter an unknown email on the login page to be redirected to registration.
  2. Observe the email reflected in the page and test HTML tags and attributes to find one allowed by the WAF.
  3. Identify the cookie used for CSRF protection by deleting cookies one by one.
  4. Use Burp Suite search to find the endpoint that issues the CSRF cookie.
  5. Create a malicious page that opens the CSRF endpoint in a new tab on user click, then submits a POST form with the XSS payload after a delay.

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.

A web page took an email address typed by the user and put it back into the page without cleaning it, so special characters could become code. A firewall (WAF) tried to block common attack patterns, but the author found a different HTML tag that got through. They also found a way to make the victim's browser fetch a security token automatically, so a malicious page could submit a form on the victim's behalf.

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.