Skip to content
XSS Disclosed report Beginner

Browser cross-site scripting filter misconfiguration

The web application did not send an X-XSS-Protection header, so browsers used their default behaviour where detecting a cross-site scripting attack does not stop the page from rendering. An attacker could potentially exploit this to have injected script execute in a victim's browser.

yourdarkshadow Follow

Originally disclosed on HackerOne

  • Triaged in 2 days
  • Fixed in 5 months
  • Disclosed after 5 months

Issue detail :- No X-XSS-Protection header was set in the response. This means that the browser uses default behaviour that detection of a cross-site scripting attack never prevents rendering.

Remediation detail The following header should be set:

X-XSS-Protection: 1; mode=block

Issue background :- Cross-site scripting (XSS) filters in browsers check if the URL contains possible harmful XSS payloads and if they are reflected in the response page. If such a condition is recognized, the injected code is changed in a way, that it is not executed anymore to prevent a succesful XSS attack. The downside of these filters is, that the browser has no possibility to distinguish between code fragments which were reflected by a vulnerable web application in an XSS attack and these which are already present on the page. In the past, these filters were used by attackers to deactivate JavaScript code on the attacked web page. Sometimes the XSS filters itself are vulnerable in a way, that web applications which were protected properly against XSS attacks became vulnerable under certain conditions.

Remediation background :- It is considered as better practice to instruct the browser XSS filter to never render the web page if an XSS attack is detected.

The original report as published on HackerOne, by yourdarkshadow. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 did not configure the X-XSS-Protection response header, leaving the browser's default behaviour in place.

Impact

An attacker could potentially have injected script execute in a victim's browser because the browser's XSS filter would not prevent the page from rendering.

What the attacker needed

None

The fix

The application should set the X-XSS-Protection header to '1; mode=block' so the browser blocks rendering when it detects an XSS attack.

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.

Browsers have a built-in filter that tries to spot cross-site scripting (XSS), which is when an attacker sneaks harmful code into a web page so it runs in someone else's browser. This report says the website did not tell the browser to block the page when the filter detects an attack, so the page still loads and the harmful code might run. The suggested fix is to add a response header that tells the browser to block rendering when it detects XSS.

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 yourdarkshadow

View all

6 more disclosed reports, best first.

More from ReddAPI

View all

The newest disclosed reports for this program.

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.