WAF bypass and java script incomplete handling of Unicode characters might leads to dom-xss
The report claims that a Cloudflare WAF in front of a share endpoint can be bypassed with a crafted query value, and that a jQuery selector-escaping helper mishandles Unicode surrogate pairs, which the author says could lead to DOM-based XSS. The author states the WAF bypass alone does not trigger XSS and only describes the DOM-XSS as a possibility.
- Disclosed after 9 days
hello,
WAF : doppler uses cloudfare firewall to prevent unwanted malicous injections "https://share.doppler.com/ext/jquery/dist/jquery.min.js?c=%22%3Cscript%3Ealert(%27XSS%27)%3C/script%3E%22" by accessing the endpoint you'll get to know that!
But I found that this code "">%0D%0A%0D%0A<x '="foo"><x foo='><img src=x onerror=javascript:alert(`cloudfrontbypass`)//'>" bypass the cloud fare !
"https://share.doppler.com/ext/jquery/dist/jquery.min.js?c=%22%3E%0D%0A%0D%0A%3Cx%20%27=%22foo%22%3E%3Cx%20foo=%27%3E%3Cimg%20src=x%20onerror=javascript:alert(cloudfrontbypass)//%27%3E"
it doesn't initiate the xss but I can able to bypass the WAF bypass!
DOM-XSS: implementation of ce.escapeSelector is indeed vulnerable to DOM-based XSS due to its incomplete handling of Unicode characters, specifically surrogate pairs.
Here's why:
Surrogate Pairs: Unicode uses surrogate pairs to represent characters outside the Basic Multilingual Plane (BMP). A surrogate pair consists of two 16-bit code units that together represent a single character. Incomplete Escaping: The charCodeAt function returns the code unit at a specific index. When dealing with a surrogate pair, charCodeAt will only return the code unit of the first or second surrogate, not the combined character. This leads to incorrect escaping, as the hexadecimal representation of a single surrogate does not accurately represent the intended character. XSS Exploitation: An attacker could craft a malicious selector that includes a surrogate pair within it. The incomplete escaping would allow the surrogate pair to be interpreted as part of the selector in unexpected ways. This could potentially: Manipulate the target of the selector, selecting unintended elements. Inject JavaScript code into the selector, leading to arbitrary code execution within the context of the web page.
'div[id="\\uD83D\\uDC4D;alert(1)//"]'
Impact
attackers can inject malicious code that steals sensitive user information like login credentials, personal details, and financial data.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the selector-escaping helper processes each 16-bit code unit separately, so surrogate pairs that form one Unicode character are escaped incorrectly.
Impact
The author claims an attacker could inject JavaScript through a crafted selector and steal user data, but no working exploit is demonstrated and the WAF bypass alone did not trigger XSS.
What the attacker needed
Crafted selector value reaches the helper
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 report has not been written yet. The Original tab links to the source.
A WAF is a filter that tries to block malicious-looking requests before they reach the site. The author says they found a request that slips past that filter, and separately argues that a piece of JavaScript that escapes text for use in selectors gets confused by some Unicode characters. They do not show a working attack that actually runs code in a victim's browser.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.