Skip to main content
All Terms Glossary

Secure Headers

Definition

Secure headers are HTTP response headers that tell browsers how to handle various security aspects of web content. These include headers like HSTS, CSP, X-Frame-Options, and others. Properly configured security headers provide an additional layer of defense against various attacks including XSS, clickjacking, and protocol downgrade attacks.

What secure headers are

Secure headers are HTTP response headers a server sends to tell the browser how to treat a page's content and connections. Rather than living in the page body, they configure the browser's own defences: Content-Security-Policy restricts which scripts and resources may load, Strict-Transport-Security forces HTTPS, X-Frame-Options (or CSP frame-ancestors) blocks framing, X-Content-Type-Options stops MIME sniffing, and Referrer-Policy and Permissions-Policy limit what data and APIs a page exposes. Each header targets a specific class of attack. Because the browser enforces them, they add defence in depth on top of server-side validation and application logic, and they are usually cheap to deploy at the web server, CDN, or edge.

Why header configuration matters

Missing or weak security headers leave known attack classes open even when the application code is sound. Without HSTS a user can be downgraded to plain HTTP and intercepted; without a framing restriction the page can be clickjacked; without a Content Security Policy an injected script runs freely. Headers are a low-effort, high-coverage control, which is why they appear in compliance checks and automated scanners. But they are only a baseline: a permissive CSP that keeps unsafe-inline, or an HSTS header without includeSubDomains, gives a false sense of safety. Configuration detail matters as much as presence, and headers protect the first-party document, not the behaviour of the third-party scripts it loads.

Hardening headers, and cside's narrower role

Set a strict Content-Security-Policy (nonce or hash based, no unsafe-inline), HSTS with a long max-age and includeSubDomains, X-Content-Type-Options: nosniff, a framing restriction, and a tight Referrer-Policy; test with a header scanner and roll CSP out in report-only mode first. Remember that headers can be stripped or weakened downstream, as malicious browser extensions and injected code can remove them client-side. cside's role is narrower and complementary: it manages and monitors CSP, and by routing third-party scripts through a Script method and analysing the payload it catches malicious script behaviour that headers alone permit, keeping forensic records useful for PCI DSS 6.4.3 and 11.6.1.

Definition

Which security headers matter most for a typical website?

A strict Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options set to nosniff, and a framing control such as X-Frame-Options or CSP frame-ancestors cover the highest-impact risks: script injection, protocol downgrade, MIME confusion, and clickjacking. Referrer-Policy and Permissions-Policy are valuable additions for limiting data leakage and restricting powerful browser APIs.

Definition

Can security headers be removed after the server sets them?

Yes. Proxies, misconfigured CDNs, and especially malicious or over-privileged browser extensions can strip or alter response headers before or after they reach the browser. That is why headers are one layer of defence rather than a guarantee, and why monitoring what scripts actually do in the browser still matters.

Got more questions

Talk to a security expert

We answer client-side security questions every day. Bring yours.

Book a demo

Want to walk through this with an engineer?

Thirty minutes, on your own site. Not a slide deck.

We'll show you:

Which third-party scripts are running on your site right now
Where you stand on PCI DSS 6.4.3 and 11.6.1
How much of your traffic is bots and AI agents

Rather just send a question?

Finding open slots…

Real humans only. We'd know.

Having trouble booking? Open scheduler in a new tab

What are you trying to solve?

Tell us in a line and we'll come back with something useful, not a generic pitch.

We usually help with:

Seeing which third-party scripts run on your site
PCI DSS 6.4.3 and 11.6.1 evidence
Bots, AI agents and account takeover

Prefer to just book a time? Pick a slot instead