{"reader":"the saved page's own text as drawn by the browser, each line checked for ink on this picture (no OCR guesswork)","reading_order":[{"area":"address strip","text":"URSY.com saved copy  ·  read 2026-12-01"},{"area":"address strip","text":"https://web.dev/articles/strict-csp","boxed_in_red":true},{"area":"page","text":"<script>","box":[338,72,401,89]},{"area":"page","text":"tag as trusted.","box":[410,71,511,88]},{"area":"page","text":"A Content Security Policy based on nonces or hashes is often called a","box":[334,115,830,132]},{"area":"page","text":"strict CSP","box":[835,115,906,132]},{"area":"page","text":". When an","box":[906,115,979,132]},{"area":"page","text":"application uses a strict CSP, attackers who find HTML injection flaws generally can't use them to","box":[334,143,1020,160]},{"area":"page","text":"force the browser to execute malicious scripts in a vulnerable document. This is because strict CSP","box":[334,171,1036,188]},{"area":"page","text":"only allows hashed scripts or scripts with the correct nonce value generated on the server, so","box":[334,199,992,216]},{"area":"page","text":"attackers can't execute the script without knowing the correct nonce for a given response.","box":[334,227,967,244]},{"area":"page","text":"Note:","box":[354,302,390,318]},{"area":"page","text":"To protect your site from XSS, make sure to sanitize user input","box":[393,302,781,318]},{"area":"page","text":"and","box":[785,302,808,318]},{"area":"page","text":"use CSP as an extra security layer. CSP","box":[812,302,1062,318]},{"area":"page","text":"is a","box":[354,326,376,342]},{"area":"page","text":"defense-in-depth","box":[380,326,485,342]},{"area":"page","text":"technique that can prevent the execution of malicious scripts, but it's not a substitute for","box":[489,326,1030,342]},{"area":"page","text":"avoiding and promptly fixing XSS bugs.","box":[354,350,598,366]},{"area":"page","text":"Why should you use a strict CSP?","box":[334,418,689,445]},{"area":"page","text":"If your site already has a CSP that looks like","box":[334,487,647,504]},{"area":"page","text":"script-src www.googleapis.com","box":[655,488,885,505]},{"area":"page","text":", it's probably not","box":[889,487,1009,504]},{"area":"page","text":"effective against cross-site. This type of CSP is called an","box":[334,515,735,532]},{"area":"page","text":"allowlist CSP","box":[740,515,833,532]},{"area":"page","text":". They require a lot of","box":[833,515,984,532],"boxed":true},{"area":"page","text":"customization and can be","box":[334,543,515,560],"boxed":true},{"area":"page","text":"bypassed","box":[520,543,588,560],"boxed":true},{"area":"page","text":"by attackers.","box":[593,543,684,560],"boxed":true},{"area":"page","text":"Strict CSPs based on cryptographic nonces or hashes avoid these pitfalls.","box":[334,587,858,604]},{"area":"page","text":"Strict CSP structure","box":[334,642,539,669]},{"area":"page","text":"A basic strict Content Security Policy uses one of the following HTTP response headers:","box":[334,711,957,728]},{"area":"page","text":"Nonce-based strict CSP","box":[334,755,515,772]},{"area":"page","text":"Content-Security-Policy:","box":[318,835,503,852]},{"area":"page","text":"script-src 'nonce-{RANDOM}' 'strict-dynamic';","box":[333,855,680,872]},{"area":"page","text":"object-src 'none';","box":[333,875,472,892]},{"area":"page","text":"base-uri 'none';","box":[333,895,457,912]},{"area":"label","text":"Website problem · Security and HTTPS · official source: web.dev"},{"area":"label","text":"The Content-Security-Policy does not stop injected scripts"},{"area":"label","text":"Source and record: ursy.com/truth-spine/I-0115/"},{"area":"label badge","text":"URSY.com"},{"area":"label badge","text":"TRUTH SPINE"},{"area":"label badge","text":"FACT RECORD I-0115"},{"area":"label","text":"Every fact on URSY.com is recorded with its source in the URSY.com Truth Spine. Explore them all at ursy.com/truth-spine"}],"not_read":"Lines hidden on the page (for example icon names the saved copy cannot draw) are left out."}
