Troubleshooting
A page shows the old header after a deploy
Section titled “A page shows the old header after a deploy”A deploy writes the headers to the project and clears the cache of the project. The dashboard says a deploy can take up to 30 seconds. A page can show the old header for about a minute.
-
Wait one minute.
-
Read the headers:
Terminal window curl -sI https://www.example.com/ | grep -i -E 'content-security-policy|reporting-endpoints' -
If the old header still shows, reload the page in the browser without its cache.
-
If the header is still wrong after a few minutes, select Check for drift now on the Overview tab.
The origin sends its own policy
Section titled “The origin sends its own policy”An application behind the project can send its own Content-Security-Policy header. The setup and the deploy step tell you when it does.
| Your mode | What happens |
|---|---|
| Report-only | The enforcing policy of the origin stays in force. Browsers enforce the policy of the origin and report against the policy of Quant |
| Enforcing | The policy from Quant replaces the policy that the origin sends |
In step 1 of the setup, select Import as version 1 to start from the policy of the origin. Then you do not lose the sources that the origin already allows.
Do not also set a policy in a <meta> tag. A browser applies every policy it receives, and a resource must pass all of them.
The Base URL redirects
Section titled “The Base URL redirects”Quant reads the live policy of the site from the Base URL. It follows a redirect on the same host, for example from / to /en/.
It does not follow a redirect to another host. If https://example.com redirects to https://www.example.com, the check reports “the scan address redirects to another host”. Set the Base URL to the final host in Policy > Site settings.
Validation finds eval
Section titled “Validation finds eval”A validation finding for eval means that a script calls eval(), new Function() or a similar function that runs text as code. The policy blocks this by default.
- Find the script. The Security sinks list on the Script integrity tab shows these calls.
- If you can, remove the call or update the library. Many libraries have a build that does not use
eval. - If the site must have it, select Allow ‘unsafe-eval’ on the finding and confirm the dialog Weaken script protection?.
For WebAssembly, the fix is 'wasm-unsafe-eval'. It lets pages compile and run WebAssembly, and eval() stays blocked.
An inline script has no hash to approve
Section titled “An inline script has no hash to approve”With Strict scripts on, the policy allows an inline script only by its hash. If a finding says that the inline script has no hash to approve:
- scan for sources again to get its hash, or
- move the script to a file, or
- turn off strict scripts in Policy > Site settings.
An inline script whose content changes on each page load has a new hash each time. Move it to a file.
The site breaks in enforcing mode
Section titled “The site breaks in enforcing mode”- On the Policy tab, select Switch to report-only mode, then deploy. Browsers stop blocking.
- Read the Violations tab, sorted by Most frequent. Approve the sources that the site needs.
- Generate, validate and deploy the new version in report-only mode.
- Change to enforcing mode again when no new report shows a source that the site needs.
The Violations tab has many reports for hosts you do not know
Section titled “The Violations tab has many reports for hosts you do not know”Browser tools such as a translate tool cause most of these reports. They are not a problem with the site. See Reports that the site does not cause.
The Violations tab is empty
Section titled “The Violations tab is empty”- Reports arrive only after a policy is deployed.
- A browser sends a report only when a page breaks the policy. A site with a correct policy and little traffic has few reports.
- Make sure that the response has the
Reporting-Endpointsheader and that the policy on the page is the policy from Quant.
I cannot change the CSP headers in Headers or with the API
Section titled “I cannot change the CSP headers in Headers or with the API”After a policy is deployed, the CSP page manages Content-Security-Policy, Content-Security-Policy-Report-Only and Reporting-Endpoints. Headers shows them as read-only. The custom headers API returns status 200 and does not change them; the response header X-Quant-Warning names them. Change the policy on the CSP page.
The page shows drift
Section titled “The page shows drift”Someone changed the project headers outside the CSP page, or another deploy replaced the headers. See Drift.
A scan fails or does not start
Section titled “A scan fails or does not start”| Message | Action |
|---|---|
| “The scan failed for every page” | Make sure that each page loads in a browser at the Base URL, then scan again |
| “A site can run 120 scans an hour” | Wait, then try again |
| “Enable at least one page” | Add or enable a page in Pages |
| “The page is large. The scan result was cut” | Some sources can be missing. Check the Sources list, and add a missing source by hand |
| “Check limit reached” on a drift check | A site can be checked 2 times a minute and 20 times an hour. Wait, then try again |
The page says “CSP is paused for this project”
Section titled “The page says “CSP is paused for this project””The headers that Quant deployed stay in place. Scans, schedules, drift checks and alerts are stopped. Contact Quant to get access again.
