pentesting, updated
Test for Content Security Policy
Check whether a CSP exists and whether it actually blocks the injection techniques it's meant to.
Goal
Confirm the CSP, if present, meaningfully restricts script execution rather than being a checkbox with holes in it.
How to test
curl -sI https://example.com | grep -i content-security-policy
Check the policy for weakening keywords and run it through CSP Evaluator for a fast second opinion.
What to look for
unsafe-inline, unsafe-eval, bare eval() usage, unsafe-hashes, or broad wildcards (https://*, *.cdn.com) in script-src — any of these can let a reflected/stored XSS execute despite the header being present.
References
- OWASP WSTG-CONF-12 — Test for Content Security Policy.