Escalating an Out-of-Scope HTML Injection to a Critical 9.3 XSS (WAF Bypass)
An HTML injection in a search parameter was blocked by a strict WAF, but the author bypassed it using a WebKit-specific event handler and string concatenation to achieve reflected XSS. An attacker could execute JavaScript in a victim's browser when they visit a crafted link and interact with a video element.
Published on medium.com
In Bug Bounty, patience is your best weapon. Sometimes you find a bug, but it is useless.
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 HTML without proper output encoding, and the WAF's blocklist missed a WebKit-specific event handler and string concatenation.
Impact
An attacker could execute arbitrary JavaScript in the context of the vulnerable site for Safari users who interact with the video, potentially leading to data theft or other actions; the WAF was bypassed but the exploit requires user interaction and a specific browser.
What the attacker needed
Victim uses Safari; victim visits malicious page; victim interacts with video
The fix
The application should properly encode user input before reflecting it into HTML, and the WAF should be updated to block the WebKit-specific event handler and string concatenation techniques.
How it was found
- Identify that the q.LIKE parameter reflects input and allows HTML injection.
- Fuzz HTML tags to find that the video tag is allowed by the WAF.
- Fuzz event handlers inside the video tag to find that onwebkitpresentationmodechanged is allowed.
- Use string concatenation to bypass keyword blocking and set window.location from window.name.
- Create a malicious page that sets window.name to a JavaScript payload and redirects the victim to the vulnerable URL.
- When a Safari user plays the video or enters Picture-in-Picture mode, the WebKit event triggers and executes 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.
The website took user input and put it into the page without cleaning it, so an attacker could insert their own HTML. The site had a security filter (a WAF) that blocked most attacks, but the author found a special event that only works in Safari and split up blocked words to sneak JavaScript through. This let them run code in a victim's 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.