HTTP security headers meaning, in plain words

HTTP security headers are extra information that tells the browser how to behave safely. The main headers named by OWASP, and why they should be added one at a time.

Written by: Mio Kanzaki(Security Analyst (AI))Reviewed by: 千葉圭介Updated

Security headers are extra information that tells the browser how to behave safely. When a server returns a page, it includes safety instructions in the response headers that accompany the body. The OWASP HTTP Headers Cheat Sheet says that suitable response headers help prevent problems such as XSS, clickjacking and information leaks.

How do security headers work?

They resemble the "handle with care" and "this side up" labels on a parcel. The contents (the page) are the same, but with a label the receiving side (the browser) handles it differently.

The main headers in the OWASP document are these. HSTS makes the browser always use encrypted traffic, and CSP narrows where content may be loaded from.

X-Content-Type-Options makes the browser handle a file as the type declared. X-Frame-Options stops display inside another site's frame. Referrer-Policy limits how much referrer information is sent, and Permissions-Policy limits use of features such as the camera and location.

The same document advises removing the Server and X-Powered-By headers, which reveal the software in use, or hiding their contents. X-Frame-Options is a header described in the IETF's RFC 7034. The overall picture of configuration mistakes is in the page on security misconfiguration. Whether the headers are present, as seen from outside, can be checked in the free URL check.

Why do security headers matter?

OWASP describes response headers as easy to introduce while raising safety. In some cases they can be added through server or CDN settings, without rewriting the page's program.

There is an order to adding them, though. A strict CSP can block advertising and measurement tags and payment components. HSTS can make a site unreachable if the certificate expires. Add them one at a time, and each time check login, payment and the contact form.

Related terms

  • HSTS: tells the browser to use only encrypted traffic
  • CSP: tells the browser which sources it may load from
  • X-Frame-Options: a setting that stops display inside another site's frame
  • Security misconfiguration: leaving defaults in place or leaving unneeded features open

Frequently asked questions

How many security headers are enough?

There is no fixed number. Choose the ones that suit your site from the main headers in the OWASP document, add them one at a time, and check the display. Keeping them in place after you have verified that the site works matters more than the count.

Can adding them break how the site is displayed?

Yes. For example, a CSP that limits load sources too strictly can stop advertising or measurement tags and payment components from working. Do not add everything at once. Introduce them in stages.

Next step

When configuration mistakes happen, and the order of review, are described on the page about security misconfiguration. To plan the order of introduction with us, contact us.

Frequently asked questions

How many security headers are enough?

There is no fixed number. Choose the ones that suit your site from the main headers in the OWASP document, add them one at a time, and check the display. Keeping them in place after you have verified that the site works matters more than the count.

Can adding them break how the site is displayed?

Yes. For example, a CSP that limits load sources too strictly can stop advertising or measurement tags and payment components from working. Do not add everything at once. Introduce them in stages.

See what an attacker can see, today

The free URL check returns a grade in under a minute. For costs and next steps, book a free consultation.