====== HTTP Security Headers ====== **HTTP Security Headers** are HTTP response headers returned by a web server that instruct the user's web browser to enforce security protections. Enabling these headers strengthens site defense against cross-site scripting (XSS), clickjacking, drive-by downloads, session hijacking, and downgrade attacks. Deploying properly configured security headers is a core component of web application hardening for web applications and API endpoints. ---- ===== Core HTTP Security Headers ===== ^ Header ^ Purpose ^ Recommended Value / Baseline ^ | **Content-Security-Policy (CSP)** | Restricts loaded scripts, styles, images, and endpoints to authorized domains, mitigating XSS and data injection attacks. | ''default-src 'self'; script-src 'self'; object-src 'none';'' | | **Strict-Transport-Security (HSTS)** | Enforces HTTPS connections and prevents SSL stripping attacks. | ''max-age=31536000; includeSubDomains; preload'' | | **X-Frame-Options** | Protects users against clickjacking by restricting whether the site can be embedded in ``, `