Skip to content
XSS Disclosed report Beginner

Content Security Policy not applied to error pages at multiple HackerOne endpoints

The reporter claims that appending a percent sign or a percent-plus-quote to the end of a URL on several HackerOne endpoints causes error or blank pages that lack a Content Security Policy. They then say they can bypass CSP by editing the page in the browser's developer tools and inserting an inline event handler.

brad07 Follow

Originally disclosed on HackerOne

  • Triaged in 27 hours
  • Fixed in 4 months
  • Paid in 44 days
  • Disclosed after 5 months

Summary by the researcher

#HackerOne Fix this as a measure of there Defense in Depth

The report

HackerOne CSP "script-src" includes "unsafe-inline" bypass via % and %"

Summary & Description

We utilize a strict Content Security Policy and a safe-by-default templating language to effectively neutralize Cross-Site Scripting (XSS).

We encrypt all network communications with SSL/TLS accompanied with Perfect Forward Secrecy and HTTP Strict Transport Security (HSTS), including being HSTS preloaded in most major browsers.

base in my finding i found that there was a missing or not included Content Security Policy in your website. i bypass a simple % or %" to reproduce a XSS. like what you said We utilize a strict Content Security Policy and a safe-by-default templating language to effectively neutralize Cross-Site Scripting (XSS). and We encrypt all network communications with SSL/TLS accompanied with Perfect Forward Secrecy and HTTP Strict Transport Security (HSTS), including being HSTS preloaded in most major browsers. but in this case i can bypass via inspect element.

why am i getting this error or a blank page ? with a simple % or %" at the and point of a url ? i can bypass your Content Security Policy

Steps To Reproduce

at first if you Inspect element and Edit a HTML at any line you will getting this error

Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self' www.google-analytics.com". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

which is good, but in my case, i can bypass your Content Security Policy with % or %" at the end point of a any url

  1. Go to any HackerOne Subdomains
  2. add % or %" at the end point
  3. Inspect element and Edit as HTML at any line
  4. paste the payload, <img src=x onerror=alert('Hacker1')>
  5. now i can bypass your Content Security Policy

Proof of Concept Video https://www.youtube.com/watch?v=zMjTgpm-dLE

Tested Websites

https://hackerone-attachments.s3.amazonaws.com https://api.hackerone.com https://hackerone.com https://www.hackerone.com https://profile-photos.hackerone-user-content.com

Reference https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src https://www.websec.be/blog/cspreporting/

Platforms and Tested Browser

Tested in Windows 7 and 10 Google Chrome latest Version Microsoft Edge 40.15063.0.0

Regards: WH-PH

The original report as published on HackerOne, by brad07. 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 error or blank pages returned for malformed URLs are served without the Content Security Policy header that normal pages include.

Impact

The missing header on error pages could weaken defence in depth, but the demonstrated bypass only works by editing the page in one's own browser, so no real cross-site scripting against another user is shown.

What the attacker needed

Attacker edits page in own browser; malformed URL with trailing % or %"

How it was found

  1. Open any HackerOne subdomain.
  2. Append a percent sign or a percent-plus-quote to the end of the URL.
  3. Open the browser developer tools and edit a line of HTML.
  4. Insert an image tag with an inline error handler and observe it runs.

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 Content Security Policy is a rule the website sends to the browser telling it which scripts are allowed to run, which helps stop injected scripts. The reporter says some error pages on HackerOne do not send this rule. However, their demonstration relies on editing the page inside their own browser, which a real attacker cannot do to a victim, so the report does not show a genuine attack.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More from HackerOne

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.