Skip to content
XSS Write-up Intermediate

From Blocked to Bypassed: A Reflected XSS Journey with accesskey

A reflected cross-site scripting vulnerability existed in a hidden input field where an attacker could inject an accesskey attribute and an event handler, requiring the victim to press a specific key combination to trigger the payload. The initial fix blocked the lowercase 'onclick' keyword, but the attacker bypassed it by using uppercase 'ONCLICK', and the issue was later permanently fixed by sanitising double quotes.

xploiterr Follow

Published on medium.com

I was testing this domain from a program which provides swag. First we have attribute context injection where we can break out using “ however the characters <> are HTML encoded so we can’t create the new tag in this case.

xploiterr, 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 reflected user input into an HTML attribute without properly encoding double quotes, allowing attribute injection and event handler execution.

Impact

An attacker could execute arbitrary JavaScript in a victim's browser if the victim pressed a specific key combination, potentially leading to session hijacking or other client-side attacks.

What the attacker needed

Victim clicks a link; victim presses a key combination

The fix

The issue was permanently fixed by sanitising double quotes to their HTML entity.

How it was found

  1. Inject a double quote to break out of the attribute and add an accesskey attribute and an onclick handler.
  2. Send the crafted URL to a victim.
  3. The victim must press ALT+SHIFT+X on Firefox Windows/Linux or CTRL+ALT+X on macOS to trigger the payload.

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 when an attacker sneaks harmful code into a trusted website so it runs in a victim's browser. Here, the attacker could add a special keyboard shortcut to a hidden form field, and if the victim pressed that shortcut, a pop-up would appear, proving the code ran. The site first tried to block the attack by filtering one word, but the attacker changed the capitalisation to get around it.

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 xploiterr

View all

19 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.