A Tale of Breaking SAP's SuccessFactors's XSS Filter
The returnurl parameter was reflected unescaped inside a JavaScript single-quoted string, allowing an attacker to break out and execute script. The site's blacklist filter could be bypassed with alternative function names or encoded keywords, enabling XSS across many sites using the same filter.
Published on respectxss.blogspot.com
The original lives on respectxss.blogspot.com
We do not hold its text, 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 a JavaScript context without proper encoding, and relied on an incomplete blacklist filter that could be bypassed.
Impact
An attacker could execute arbitrary JavaScript in the context of the vulnerable sites, potentially affecting users of hundreds of web applications that used the same filter.
What the attacker needed
Victim clicks a crafted link; vulnerable site uses the SuccessFactors XSS filter
The fix
The issue was fixed by SAP after almost three months, though the exact fix method is not described.
How it was found
- Inject a harmless probe string into the returnurl parameter and observe it reflected inside a script block.
- Test a common XSS payload and see that alert(1) is filtered to XSS-VIOLATION.
- Replace alert(1) with confirm(1) and observe that it is not filtered.
- Use the payload '-confirm(1)-' to break out of the single-quoted string and execute the function call.
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 a value from the URL and put it directly into a script on the page without cleaning it. Because the value was placed inside quotes, an attacker could close the quote and add their own JavaScript, which would run in the victim's browser. The site tried to block some dangerous words, but the blocklist was incomplete and easy to get around.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.