{"visual_analysis_performed":true,"described_by":"Claude, looking at this picture alone, checked against the page's own text and the record","subject":"Saved copy of the web.dev article 'Mitigate cross-site scripting (XSS) with a strict Content Security Policy (CSP)', with one sentence boxed in red across two lines","image_role":"web_page_screenshot_source_passage","photo_type":"screenshot of our saved copy of a public web page","how_it_looks":"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.","red_boxes":[{"where":"address strip, round the source address","words":"https://web.dev/articles/strict-csp"},{"where":"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","words":"They require a lot of customization and can be bypassed by attackers."}],"colours":["white","dark grey text","pale blue note band","blue links","light grey code block","purple and pink code text","red outlines","light blue label band","navy","royal blue badge"],"logos_and_marks":["URSY.com Truth Spine badge"],"people":"none","quality":"Sharp and readable. The top line is just below the address strip and readable.","reading_order_summary":[{"area":"address strip","text":"URSY.com saved copy · read 2026-12-01"},{"area":"address strip","text":"https://web.dev/articles/strict-csp","boxed":true},{"area":"body text","text":"tag as trusted."},{"area":"code","text":"<script>"},{"area":"body text","text":"A Content Security Policy based on nonces or hashes is often called a strict CSP. When an"},{"area":"body text","text":"application uses a strict CSP, attackers who find HTML injection flaws generally can't use them to"},{"area":"body text","text":"force the browser to execute malicious scripts in a vulnerable document. This is because strict CSP"},{"area":"body text","text":"only allows hashed scripts or scripts with the correct nonce value generated on the server, so"},{"area":"body text","text":"attackers can't execute the script without knowing the correct nonce for a given response."},{"area":"body text","text":"Note: To protect your site from XSS, make sure to sanitize user input and use CSP as an extra security layer. CSP"},{"area":"body text","text":"is a defense-in-depth technique that can prevent the execution of malicious scripts, but it's not a substitute for"},{"area":"body text","text":"avoiding and promptly fixing XSS bugs."},{"area":"heading","text":"Why should you use a strict CSP?"},{"area":"body text","text":"If your site already has a CSP that looks like script-src www.googleapis.com, it's probably not"},{"area":"body text","text":"effective against cross-site. This type of CSP is called an allowlist CSP"},{"area":"body text","text":". They require a lot of","boxed":true},{"area":"body text","text":"customization and can be bypassed by attackers.","boxed":true},{"area":"body text","text":"Strict CSPs based on cryptographic nonces or hashes avoid these pitfalls."},{"area":"heading","text":"Strict CSP structure"},{"area":"body text","text":"A basic strict Content Security Policy uses one of the following HTTP response headers:"},{"area":"body text","text":"Nonce-based strict CSP"},{"area":"body text","text":"Content-Security-Policy:"},{"area":"body text","text":"script-src 'nonce-{RANDOM}' 'strict-dynamic';"},{"area":"body text","text":"object-src 'none';"},{"area":"body text","text":"base-uri 'none';"},{"area":"label, left","text":"Website problem · Security and HTTPS · official source: web.dev"},{"area":"label, left","text":"The Content-Security-Policy does not stop injected scripts"},{"area":"label, left","text":"Source and record: ursy.com/truth-spine/I-0115/"},{"area":"label, badge","text":"URSY.com TRUTH SPINE FACT RECORD I-0115"},{"area":"label, bottom line","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"}]}
