Content Injection on api.semrush.com to Reflected XSS
An API endpoint reflected the value of a URL parameter inside a MongoDB error message, and the researcher found a way to bypass the web application firewall to execute script in the browser. An attacker could run JavaScript in a victim's session on the API domain.
Originally disclosed on HackerOne
- Triaged in 6 hours
- Fixed in 3 months
- Paid in 21 hours
- Disclosed after 4 months
Summary by the program
The researcher found XSS vulnerability and wrote an awesome summary! :)
Summary by the researcher
While testing api.semrush.com I've found that some inputs triggered MongoDB error on /reports/v1/projects/:id/siteaudit/page/list endpoint. Contents of url parameter was reflected in error message. Unfortunately WAF blocked my XSS attempts. Fuzzing a little bit further I was able to bypass WAF with <object data=javascript:confirm(document.domain)> payload.
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 application inserted the user-supplied url parameter into a database error message that was returned to the browser without output encoding, and the WAF's filter could be bypassed with an object tag using a javascript: data value.
What the attacker needed
Victim visits a crafted link; WAF bypass needed
How it was found
- Send a request to the page list endpoint with a crafted url parameter.
- Observe that the value is reflected in a MongoDB error message.
- Try XSS payloads and note the WAF blocks them.
- Use an object tag with a javascript: data value to bypass the WAF and trigger script execution.
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 web page sometimes shows back text you typed, such as an error message. If it shows that text without cleaning it, an attacker can put code in the text and the browser will run it. This is called cross-site scripting, or XSS, and it lets an attacker act as the logged-in user.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.