Gratipay Website CSP "script-scr" includes "unsafe-inline"
The website's Content-Security-Policy for script-src includes 'unsafe-inline', which weakens protection against script injection. An attacker could potentially exploit this to carry out cross-site scripting attacks if other injection points exist.
Originally disclosed on HackerOne
- Disclosed after 21 hours
Summary:
The HTTP header of the gratipay.com website includes an unsafe CSP parameter for "script-src".
Description:
has a Content-Security-Policy configured the "script-src" parameter is set to "unsafe-inline", which allows injection of user passed values, which in result can be misused for Cross-Site Scripting attacks.
Steps to Reproduce:
Go to the following link to check your gratipay.com website's http header response: https://hackertarget.com/http-header-check/
Content-Security-Policy-Report-Only: default-src self;script-src self assets.gratipay.com unsafe-inline;
As can be seen, "unsafe-inline" is included in in the list of "script-src" parameters. For further information, see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src
Similar Report: #225833
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 CSP was configured with 'unsafe-inline' in the script-src directive, which permits inline scripts and reduces the policy's ability to block injected scripts.
Impact
The weakened CSP could allow cross-site scripting attacks if an injection point exists, though the report does not demonstrate a specific exploit.
What the attacker needed
An injection point on the site
How it was found
- Check the HTTP header response of the gratipay.com website using a header checking tool.
- Observe that the Content-Security-Policy-Report-Only header includes 'unsafe-inline' in the script-src directive.
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 (CSP) is a rule that tells the browser which sources of scripts are allowed to run on a page. When 'unsafe-inline' is included, the browser also allows scripts written directly into the page, which makes it easier for an attacker to inject malicious code if they can add content to the site. This report points out that the policy is weaker than it should be.
What is Smuggling / CRLF?
A front end and a back end split one connection's bytes into requests differently, letting an attacker hide a request inside another user's.