Cyber Risks · PortSwigger Research

Content security policy

Summary: PortSwigger's explainer describes content security policy as a browser mechanism, enabled through a Content-Security-Policy HTTP response header containing directives separated by semicolons, that restricts which resources a page can load and whether other pages can frame it. It notes that policies allowing image requests can still be used to send data to external servers, and that Chrome's script-src-elem directive allows existing script-src directives to be overwritten when input is reflected into a report-uri directive.

Why it matters: A CSP that blocks scripts but permits images still leaves a channel for exfiltrating CSRF tokens, and a reflected report-uri parameter can let an attacker append directives that overwrite the policy itself.

Read the original at PortSwigger Research ↗

Topics
Vulnerabilities & Patching
Related