Website security headers, explained simply

By the FarSec team · Updated

In short: security headers are short instructions your web server sends with every page, telling the visitor's browser how to protect them. They cost nothing, need no new software and are usually set in one place (your hosting panel, .htaccess, Nginx config or Cloudflare). In our review of 130 well-known Pakistani companies, 54% had no Content-Security-Policy, 41% had no clickjacking protection and 38% had no HSTS. Start with HSTS, X-Frame-Options and X-Content-Type-Options, then add a Content-Security-Policy carefully.

Why this matters for a business website

Your website is often the first thing a customer, bank or supplier checks. If an attacker can inject a script into it, frame it inside a fake page, or push visitors onto an unencrypted connection, they can steal form data, show fake payment details or damage trust in your name. Security headers close several of these doors at once, and auditors, banks and enterprise customers increasingly look for them in vendor reviews.

The six headers to know

Check your site in one minute

  1. Open your website in Chrome or Edge, press F12, go to the Network tab and reload the page.
  2. Click the first item (your page) and look at Response Headers.
  3. Look for the six names above. Anything missing is a quick win.

Free online checkers that read the same public headers also exist. While you are there, check that http:// redirects to https:// and that the server does not announce its exact software version (for example Apache/2.4.41), which helps attackers find known flaws.

A safe order to switch them on

  1. Week 1: add X-Content-Type-Options, Referrer-Policy and X-Frame-Options. These almost never break anything.
  2. Week 1: make sure every page and image loads over HTTPS, then add HSTS with one year. Only add includeSubDomains once you are sure every subdomain (mail, portal, old test sites) works over HTTPS.
  3. Week 2: add Permissions-Policy for features you do not use.
  4. Weeks 2-4: start CSP in report-only mode (Content-Security-Policy-Report-Only), watch the browser console for what it would block, list the outside services you really use (analytics, chat widget, payment page, fonts), then switch to the enforcing header.

Where to set them

Always test on a staging copy or at a quiet time, and keep a copy of the old settings so you can roll back in minutes.

Common mistakes

Headers are one part of a secure website. Pair them with patching (see our VAPT guide), email protection (DMARC guide) and good backups.

Free check for Pakistani businesses

Send your domain to info@farsec.com.pk and we will reply with a free one-page check of your email protection (SPF, DKIM, DMARC) and website basics, including these headers. We use public information only; nothing is tested without your written permission. If you would like us to set the headers for you and confirm nothing breaks, ask in the same email.

Want a second pair of eyes? FarSec checks businesses in Pakistan for exactly these gaps and helps fix them. Email info@farsec.com.pk and tell us what worries you.