---
title: "WEB-HDR-002 Missing Content Security Policy"
canonical: https://openvapt.com/checks/WEB-HDR-002.html
html: https://openvapt.com/checks/WEB-HDR-002.html
site: OpenVAPT, https://openvapt.com/
license: OpenVAPT Source-Available Licence 1.3, https://openvapt.com/legal/licence-text.html
modified: 2026-10-14
version: 0.1.0-alpha.6
---

# WEB-HDR-002 Missing Content Security Policy

Checks that each site sends a Content-Security-Policy header.

- Domain: Web Apps
- Severity: Medium
- Control category: Web Application Security
- Fix effort: medium
- CVSS v3.1 vector: `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- CIS Controls v8: 16.7
- NIST CSF 2.0: PR.PS-01
- CWE: CWE-1021, CWE-79
- OWASP Top 10 2021: A03:2021, A05:2021
- OWASP ASVS 4.0.3: 14.4.3
- OWASP WSTG v4.2: WSTG-CONF-12
- NIST SP 800-53 Rev. 5: SI-10

## Why It Matters

A CSP limits where scripts may load from, turning many cross-site scripting (XSS) bugs from account takeover into a blocked request.

## How It Detects

Reads Content-Security-Policy from each site's home page. Missing fails. A policy containing 'unsafe-inline' in script-src (without a nonce or hash) or a bare * source is reported as weak.

## How to Fix

Start with a report-only policy to find what the site loads, then enforce, for example: Content-Security-Policy: default-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'self'

## How to Verify

```
curl -sI https://<site>/ | grep -i content-security-policy
```

## Learn the Theory

- [P5 Web Security Headers and Cookies](https://openvapt.com/academy/p5.md)
- [A8 Tracing Findings to Security Requirements](https://openvapt.com/academy/a8.md)

## References

- [OWASP Content Security Policy Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Content_Security_Policy_Cheat_Sheet.html)
- [W3C Content Security Policy Level 3](https://www.w3.org/TR/CSP3/)

## Source Code

https://github.com/OpenVAPT/openvapt/blob/574f7f3333c44b75a3c649e2d93a76d507f75adf/internal/checks/web/headers.go

Run it: `openvapt scan --only WEB-HDR-002`. Read it offline: `openvapt explain WEB-HDR-002`.

---

OpenVAPT is academic, non-commercial, source-available and built by AI Cybersecurity Engineers (AI systems, not people). Free for your own use on machines you own or control, 100% at your own risk; not for sale and not for providing services. This page in HTML: https://openvapt.com/checks/WEB-HDR-002.html. Part of OpenVAPT Check Catalogue. How to cite: https://openvapt.com/cite.html. Site summary for models: https://openvapt.com/llms.txt.
