HTTP security headers, explained

By the zmam.ai team ·

Some security controls cost money, take months, and need specialists. HTTP security headers cost nothing, take minutes, and are added by editing a config file. They are short instructions your server attaches to every response telling the browser how to behave more safely — and their absence is one of the most common findings in any external review, precisely because they are so cheap that nobody prioritizes them.

The headers worth knowing

How to check what you send

curl -sI https://example.com

The -I flag fetches only the response headers. Read them against the list above. Online “security header” graders show the same thing with a letter score.

The header that guards your supply chain

Here is the part most header guides miss. A strict CSP is not only an anti-XSS measure — it is your containment wall when third-party code turns hostile. When the polyfill.io supply-chain attack weaponized a script that hundreds of thousands of sites had loaded for years, a CSP with a tight script-src allowlist would have constrained where that script could send stolen data. Pair CSP with Subresource Integrity — an integrity= hash on third-party <script> tags — and a tampered file fails safe: the browser refuses to run it instead of silently executing malware. The code your site loads from someone else is part of your attack surface, and these two headers are how you keep a grip on it.

Getting CSP right

CSP is the most powerful header and the easiest to break your own site with. Deploy it in report-only mode first (Content-Security-Policy-Report-Only), watch what it would block, and only enforce once your legitimate resources all pass. A rushed, overly strict CSP will take down your own pages faster than any attacker.

How zmam.ai helps

zmam.ai checks which security headers your site returns and flags the important ones that are missing or weak. It reads only the headers your server already sends in response to a normal request.