Skip to content
XSS Write-up Intermediate

Akamai Bypass Advanced Xss

A WAF (Akamai) blocked common XSS payloads in a returnUrl parameter, but the author found that the decodeURI function and the onbeforetoggle event handler were not blocked, allowing a crafted javascript: URI to execute script when the victim clicked a button. The attacker could run arbitrary JavaScript in the victim's browser.

hosein vita Follow

Published on infosecwriteups.com

In this write-up, we will embark on a journey to explore the intricate art of bypassing security measures by WAF in this case we will fight against Akamai. By the end of this tutorial, you will not only gain a profound understanding of the security mechanisms in place but also acquire the knowledge and skills…

hosein vita, on infosecwriteups.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 WAF's blocklist did not include the decodeURI function or the onbeforetoggle event handler, and the application inserted the returnUrl value into a javascript: URI without proper sanitisation.

Impact

An attacker could execute arbitrary JavaScript in a victim's browser when the victim clicked a crafted link, potentially leading to session theft or other client-side attacks.

What the attacker needed

Victim clicks a crafted link; WAF does not block decodeURI or onbeforetoggle

The fix

The issue was fixed after communication with Akamai, and the payload is no longer exploitable.

How it was found

  1. Find an endpoint with a returnUrl parameter that is reflected into a javascript: URI.
  2. Test that javascript:decodeURI() is not blocked by the WAF.
  3. Discover that the <button> tag and the onbeforetoggle event handler are not blocked.
  4. Split the alert() call into separate variables and concatenate them inside decodeURI to bypass the WAF's alert blocking.
  5. Deliver the final payload and click the 'Try Again' button to trigger the XSS.

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 application firewall (WAF) is a filter that tries to block malicious input. The author found a way to sneak a script past the filter by using a JavaScript function called decodeURI and an unusual event handler called onbeforetoggle. When a victim clicked a button, the script ran in their browser, which is called cross-site scripting (XSS).

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 hosein vita

View all

2 more disclosed reports, best first.

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.