Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Are HTTP Security Headers?

HTTP security headers are response headers that instruct the browser to enforce restrictions on a page, from transport and framing to script sources and referrer leakage.

Illustration for the cybersecurity term HTTP Security Headers
Home / Blog / Cybersecurity Terms / What Are HTTP Security Headers?
17 November 2026

What Are HTTP Security Headers?

What Are HTTP Security Headers?

HTTP security headers are instructions a server attaches to a response so the browser applies restrictions the page itself cannot enforce. They are cheap to deploy and they work entirely on the client, which makes them the most reliable defence-in-depth layer available to a web application and also the easiest to get wrong, because a header with a syntax error is silently ignored.

The Set Worth Configuring

HeaderPurposeSensible value
Content-Security-PolicyControls which scripts, styles, and connections are permittedNonce-based policy with object-src 'none'
Strict-Transport-SecurityForces HTTPS for the hostmax-age=31536000; includeSubDomains
X-Content-Type-OptionsStops the browser guessing a media typenosniff
Referrer-PolicyLimits what is leaked in the Referer headerstrict-origin-when-cross-origin
Permissions-PolicySwitches off device APIs the page does not usecamera=(), microphone=(), geolocation=()
Cross-Origin-Opener-PolicySevers the window reference to cross-origin openerssame-origin
Cross-Origin-Resource-PolicyPrevents other sites embedding your resourcessame-origin
Cache-ControlKeeps authenticated responses out of shared cachesno-store on private pages

Where Each One Earns Its Place

Content Security Policy and HSTS carry most of the value and each deserves its own treatment, because both need planning rather than a copied line of configuration.

X-Content-Type-Options: nosniff matters more than its brevity suggests. Without it, some browsers inspect the body of a response and may treat a text file as HTML, which turns a benign upload or an error page into script execution. It also stops a stylesheet or script being loaded when its declared type does not match.

Referrer-Policy addresses a quiet leak. A page at /reset-password?token=abc that links out to a third party sends the full URL, token included, in the Referer header. The recommended value sends the origin only on cross-origin navigations and nothing at all when moving from HTTPS to HTTP.

Permissions-Policy, which replaced Feature-Policy, lets a page disclaim capabilities it does not need, so an injected script or a compromised iframe cannot reach the camera, microphone, or payment request API.

The cross-origin set, Cross-Origin-Opener-Policy, Cross-Origin-Embedder-Policy, and Cross-Origin-Resource-Policy, was introduced in response to Spectre-class attacks. Together they place a document in its own browsing context group, which both mitigates side-channel reads and enables high-resolution timers for applications that need them.

Headers to Stop Using

Deploying and Verifying

Set headers in one place, usually the reverse proxy or a middleware layer, so every response carries them, including error pages, redirects, API responses, and static files. Headers applied only to the main document leave those paths uncovered, and an attacker will find the uncovered path. Where a framework sets defaults, such as Helmet for Express or SecurityHeaders middleware in ASP.NET Core, read what it actually emits rather than trusting the description.

Verification should use real traffic. securityheaders.com and the Mozilla Observatory grade a single URL quickly; a crawl of your own site comparing headers across content types finds the gaps those tools miss. Remember that these headers constrain the browser and have no effect on a non-browser client, so they supplement server-side controls such as input validation and output encoding rather than standing in for them. Our web application security testing reviews the header set across every response type as part of the assessment.

FAQ – Frequently Asked Questions

Which Headers Should We Add First?

Start with X-Content-Type-Options, Referrer-Policy, and the frame-ancestors restriction, because all three are low risk and can usually be deployed in an afternoon. Strict-Transport-Security comes next, introduced with a short max-age. Content Security Policy is last and takes the most effort, since it requires inventorying every script the application loads.

Will Adding Security Headers Break Our Site?

Most will not. The ones that can are Content Security Policy, which blocks resources the application legitimately uses if the policy is incomplete, and HSTS with includeSubDomains, which makes any subdomain without valid HTTPS unreachable. Deploy the first in report-only mode and the second only after auditing every subdomain.

Do These Headers Protect an API?

Only partially, because they are browser instructions and most API clients are not browsers. X-Content-Type-Options, Cache-Control with no-store, and Cross-Origin-Resource-Policy are still worth setting on API responses, since browsers do consume them from JavaScript. Authentication, authorisation, and rate limiting remain the controls that matter for an API.

Does a Good Score on a Header Scanner Mean We Are Secure?

No. Those tools check one URL for the presence of headers, not whether the policies are meaningful. A Content Security Policy containing unsafe-inline scores well and protects almost nothing, and a header set on the home page may be absent from the login endpoint. Treat the grade as a starting point for review.

Related Terms

You May Be Interested In These

What Is the GoAnywhere MFT Vulnerability?

Cybersecurity Terms

17 November 2026

What Is the GoAnywhere MFT Vulnerability?

Read More
What Is Adware?

Cybersecurity Terms

17 November 2026

What Is Adware?

Read More
What Is Defence Industry Cybersecurity?

Cybersecurity Terms

17 November 2026

What Is Defence Industry Cybersecurity?

Read More