# Truth Spine proof: web.dev says allowlist CSPs need a lot of customization and can be bypassed by attackers

**Problem:** The Content-Security-Policy does not stop injected scripts. Truth Spine record I-0115: https://ursy.com/truth-spine/I-0115/

**Caption.** web.dev says allowlist Content Security Policies require a lot of customization and can be bypassed by attackers. Truth Spine record I-0115.

**What this picture proves.** The problem is that the Content-Security-Policy does not stop injected scripts. The web.dev article on strict CSP says an allowlist CSP is probably not effective, adding "They require a lot of customization and can be bypassed by attackers." Those words back the problem: a loose policy that allows hosts or inline scripts can be got round, so it would not block an attack.

**What the picture shows.** At the top is a pale grey address strip. Small dark text at the left reads "URSY.com saved copy · read 2026-12-01", and below it a long white rounded bar holds the source address, "https://web.dev/articles/strict-csp", in dark grey sans type with a thin red box drawn round it. Below the strip is a white page with a central white column. At the top is the end of a line with a small grey monospace chip "<script>" and the words "tag as trusted.". A paragraph in dark grey sans type, with italic "strict CSP", explains nonces and hashes. Next is a full-width pale blue note band with a bold dark blue "Note:", blue text and an underlined link "defense-in-depth". Then comes the heading "Why should you use a strict CSP?" in large plain dark type over a thin grey rule. The paragraph under it has a monospace chip "script-src www.googleapis.com" and italic "allowlist CSP". Two thin red rectangles mark the quote: one round "They require a lot of" at the end of the second line, and one round "customization and can be bypassed by attackers." at the start of the third line, where "bypassed" is a blue link. A short line about strict CSPs follows, then the heading "Strict CSP structure", an intro line and the bold line "Nonce-based strict CSP". At the bottom is a light grey code block in purple and pink monospace: "Content-Security-Policy:", "script-src 'nonce-{RANDOM}' 'strict-dynamic';", "object-src 'none';" and "base-uri 'none';". The problem title in the label wraps onto two lines. At the bottom is the URSY.com Truth Spine label, a light blue band under a blue top line. On the left, a small grey line reads "Website problem · Security and HTTPS · official source: web.dev". Below it the problem title, "The Content-Security-Policy does not stop injected scripts", is set in big bold navy type, then "Source and record: ursy.com/truth-spine/I-0115/" with the address in blue. On the right is a blue rounded badge with white lettering: "URSY.com", "TRUTH SPINE" and "FACT RECORD I-0115". Under a thin grey rule, the bottom line reads "Every fact on URSY.com is recorded with its source in the URSY.com Truth Spine. Explore them all at ursy.com/truth-spine", with the last address in blue.

**The red outline:** address strip, round the source address: "https://web.dev/articles/strict-csp"; middle of the column, in the paragraph under 'Why should you use a strict CSP?'; two red outlines, one at the end of the second line and one at the start of the third line: "They require a lot of customization and can be bypassed by attackers."

**Printed lines, in reading order:**
- URSY.com saved copy · read 2026-12-01
- https://web.dev/articles/strict-csp **(boxed in red)**
- tag as trusted.
- <script>
- A Content Security Policy based on nonces or hashes is often called a strict CSP. When an
- application uses a strict CSP, attackers who find HTML injection flaws generally can't use them to
- force the browser to execute malicious scripts in a vulnerable document. This is because strict CSP
- only allows hashed scripts or scripts with the correct nonce value generated on the server, so
- attackers can't execute the script without knowing the correct nonce for a given response.
- Note: To protect your site from XSS, make sure to sanitize user input and use CSP as an extra security layer. CSP
- is a defense-in-depth technique that can prevent the execution of malicious scripts, but it's not a substitute for
- avoiding and promptly fixing XSS bugs.
- Why should you use a strict CSP?
- If your site already has a CSP that looks like script-src www.googleapis.com, it's probably not
- effective against cross-site. This type of CSP is called an allowlist CSP
- . They require a lot of **(boxed in red)**
- customization and can be bypassed by attackers. **(boxed in red)**
- Strict CSPs based on cryptographic nonces or hashes avoid these pitfalls.
- Strict CSP structure
- A basic strict Content Security Policy uses one of the following HTTP response headers:
- Nonce-based strict CSP
- Content-Security-Policy:
- script-src 'nonce-{RANDOM}' 'strict-dynamic';
- object-src 'none';
- base-uri 'none';
- Website problem · Security and HTTPS · official source: web.dev
- The Content-Security-Policy does not stop injected scripts
- Source and record: ursy.com/truth-spine/I-0115/
- URSY.com TRUTH SPINE FACT RECORD I-0115
- Every fact on URSY.com is recorded with its source in the URSY.com Truth Spine. Explore them all at ursy.com/truth-spine

**Where it came from.**
- Source: web.dev, "Mitigate cross-site scripting (XSS) with a strict Content Security Policy": https://web.dev/articles/strict-csp
- Saved by URSY.com on 1 December 2026 (sha256 ad843508f923a890f8c6a5b1dbdee5aee3b93da31d1dcd3ab912fa1ce1c07561).
- Look for public archive copies (a search, not a copy saved by URSY.com): https://web.archive.org/web/2026*/https://web.dev/articles/strict-csp

**The problem, explained, with how to fix it:** https://ursy.com/issues/csp-weak/

Every fact on URSY.com is recorded with its source in the URSY.com Truth Spine: https://ursy.com/truth-spine/

URSY.com - www.ursy.com
