HTTP Security Headers Evaluator

Audit HTTP response headers against OWASP security standards for HSTS, CSP, X-Frame-Options, and Referrer-Policy.

4.9 / 5· 148 verified ratings
•
100% Client-Side Privacy
•
Verified 2026 Engine
Loading tool engine...
Frequently Used With:URL Encoder & Decoder →301 Redirect Chain Checker →User-Agent Header Parser →SEO URL Slug Generator →
Institutional-Grade Accuracy & Client-Side Privacy Guarantee

Unlike conventional calculator sites that send your financial numbers, payload data, or code snippets across remote web servers, Affi-Chain processes all mathematical derivations, algorithms, and data parsing 100% locally within your browser sandbox. No tracking cookies, no server-side retention, and zero transmission lag.

What are HTTP Security Headers?

HTTP Security Headers are specialized response headers that a web server transmits to a client’s browser to instruct the browser’s security engine on how to handle website content, restrict cross-origin interactions, enforce transport encryption, and isolate execution contexts.

In modern cybersecurity architectures governed by the OWASP Top 10 and NIST frameworks, software vulnerabilities (such as Cross-Site Scripting / XSS, Clickjacking, MIME-confusion attacks, and Man-in-the-Middle / MitM interception) cannot be mitigated solely through application-level code. Even a perfectly sanitized React or Next.js application remains vulnerable if the web server fails to instruct the browser to enforce secure transport and content boundaries.

The Affi-Chain Security Headers Checker inspects remote web endpoints, evaluates their cryptographic and architectural headers against industry standards (OWASP, NIST, and Mozilla Observatory guidelines), and provides actionable, copy-paste configuration snippets to achieve an A+ Security Grade.


The 7 Essential HTTP Security Headers Matrix

Modern web infrastructure requires seven core headers to protect user privacy and system integrity:

HeaderStandard SpecificationRecommended Production ValueAttack Vector Mitigated
Strict-Transport-Security (HSTS)RFC 6797max-age=63072000; includeSubDomains; preloadSSL Stripping, Man-in-the-Middle (MitM) wiretapping, packet sniffing.
Content-Security-Policy (CSP)W3C CSP Level 3default-src 'self'; script-src 'self'; object-src 'none';Cross-Site Scripting (XSS), malicious script injections, data exfiltration.
X-Frame-OptionsRFC 7034DENY or SAMEORIGINClickjacking attacks via hidden transparent iframes.
X-Content-Type-OptionsFetch StandardnosniffMIME-type confusion attacks and executable script disguised as images.
Referrer-PolicyW3C Referrer Policystrict-origin-when-cross-originSensitive URL token leaks across third-party analytics and ad trackers.
Permissions-PolicyW3C Permissions Policycamera=(), microphone=(), geolocation=(), browsing-topics=()Unauthorized access to user hardware peripherals and sensor telemetry.
Cross-Origin-Opener-Policy (COOP)HTML Living Standardsame-originCross-origin information leaks and Spectre side-channel memory attacks.

Detailed Breakdown of Critical Directives

1. HTTP Strict Transport Security (HSTS)

HSTS forces the browser to communicate exclusively over encrypted HTTPS connections, even if a user manually types http:// into the address bar or clicks an insecure link.

  • max-age=63072000: Tells the browser to remember this HTTPS enforcement rule for two full years (63,072,000 seconds).
  • includeSubDomains: Automatically protects all subdomains (api.affichain.com, admin.affichain.com).
  • preload: Submits your domain to Google Chrome's hardcoded global preload list, ensuring even the very first connection is encrypted before DNS resolution occurs.

2. Content Security Policy (CSP)

CSP is the single most powerful defense against Cross-Site Scripting (XSS). It acts as a strict whitelist defining precisely which domains are authorized to load JavaScript, stylesheets, images, and fonts:

  • default-src 'self': Restricts all resources to your own domain by default.
  • script-src 'self': Completely blocks inline <script> tags and untrusted external CDNs unless explicitly permitted.
  • object-src 'none': Disables legacy plugins like Flash, Java applets, and Silverlight.
  • base-uri 'self': Prevents <base> tag injection attacks that redirect relative URLs to an attacker's server.

3. X-Frame-Options (Clickjacking Defense)

Clickjacking occurs when an attacker renders your login page or payment screen inside an invisible, transparent iframe layered beneath an enticing game or button on their website.

  • Setting X-Frame-Options: DENY instructs the browser to never allow your site to be framed by any external website.

Production Server Configurations

1. Next.js (next.config.js or next.config.mjs)

const securityHeaders = [
  { key: 'X-DNS-Prefetch-Control', value: 'on' },
  { key: 'Strict-Transport-Security', value: 'max-age=63072000; includeSubDomains; preload' },
  { key: 'X-Frame-Options', value: 'DENY' },
  { key: 'X-Content-Type-Options', value: 'nosniff' },
  { key: 'Referrer-Policy', value: 'strict-origin-when-cross-origin' },
  { key: 'Permissions-Policy', value: 'camera=(), microphone=(), geolocation=()' }
];

module.exports = {
  async headers() {
    return [
      {
        source: '/:path*',
        headers: securityHeaders,
      },
    ];
  },
};

2. Nginx Web Server (nginx.conf)

# Add security headers inside the server block
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
add_header X-Frame-Options "DENY" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;

Critical Deployment Traps & Troubleshooting

1. The HSTS Preload Trap

  • Submitting your domain to the HSTS Preload list (hstspreload.org) is permanent and irrevocable.
  • The Danger: If you have an internal staging server, legacy subdomain, or local intranet portal (dev.yourdomain.com) that does not yet possess an active, valid SSL certificate, enforcing includeSubDomains; preload will render that subdomain completely inaccessible worldwide in Chrome, Firefox, and Safari!
  • Best Practice: Run HSTS with a short duration (max-age=300) for one week to verify that no internal subdomains break before stepping up to two years.

2. The Broken AdSense & Google Analytics CSP Trap

  • If you introduce a rigid Content-Security-Policy: default-src 'self', you will immediately block Google AdSense, Google Tag Manager, and Vercel Analytics from loading!
  • When monetizing via advertising, ensure your CSP script whitelist accommodates trusted ad networks:
    script-src 'self' 'unsafe-inline' https://www.googletagmanager.com https://pagead2.googlesyndication.com;
    

3. The Deprecated X-XSS-Protection Header

  • Many outdated security tutorials recommend setting X-XSS-Protection: 1; mode=block.
  • Security Advisory: Modern security standards explicitly advise removing this header or setting it to 0. Research demonstrated that the legacy XSS auditor built into older Chromium browsers could be weaponized by attackers to create security vulnerabilities (Cross-Site Script Leaks) that did not previously exist. Rely on modern CSP instead.

Frequently Asked Questions

What is the most critical HTTP security header?
Strict-Transport-Security (HSTS) and Content-Security-Policy (CSP) are paramount. HSTS prevents SSL stripping attacks, while CSP blocks Cross-Site Scripting (XSS) and unauthorized script execution.
How do you prevent clickjacking attacks?
Add the "X-Frame-Options: SAMEORIGIN" header or configure the "frame-ancestors" directive within your Content-Security-Policy to prevent malicious framing.
How do I copy headers from Chrome DevTools?
Open DevTools (F12) -> Network tab -> click any request -> Headers -> scroll to "Response Headers" -> right click and select "Copy all response headers".

Explore Related Utilities