A report of “HTTP security header not detected” is a generic hardening finding, not a diagnosis by itself. It may refer to HSTS, Content Security Policy, MIME-sniffing protection, frame protection, referrer controls, browser feature restrictions, caching, or cookie attributes. Start with the scanner evidence and the exact response—not a copy-and-paste header bundle.
Security headers are often configured at the web server, application framework, reverse proxy, API gateway, CDN, or load balancer. A missing header may be easy to fix, but the right value depends on the application, API behavior, browser requirements, cookie model, embedded content, and deployment architecture.
What “HTTP Security Header Not Detected” Means
The scanner requested a URL and did not find one or more headers that its policy expects in the returned response. The finding is intentionally broad: two scanners can use the same label while checking different headers or response paths.
Common examples include:
- Strict-Transport-Security not detected on an HTTPS response.
- Content-Security-Policy not detected on a browser-rendered HTML document.
- X-Frame-Options not detected or no CSP frame-ancestors directive on a page that should not be framed.
- X-Content-Type-Options not detected where nosniff is expected.
- Referrer-Policy or Permissions-Policy not detected on browser-facing content.
- Cache-Control or safe Set-Cookie attributes missing from sensitive authenticated responses.
A missing header can be a valid defense-in-depth issue, a configuration gap limited to one route, or a low-value scanner finding on a response where that header provides little or no protection. Context determines priority.
Fast Diagnosis: What to Check Before You Change Anything
Use the scanner evidence to reproduce the exact request. A homepage check is not enough when the finding came from an API route, redirect, error page, management port, or authenticated response.
| Check | Question | Why it matters |
|---|---|---|
| URL and port | Was the finding on port 80, 443, 8443, an API hostname, or a management interface? | Different listeners and virtual hosts often use different header policies. |
| Protocol | Was the response HTTP or HTTPS? | HSTS is only honored when delivered over HTTPS; an HTTP listener should normally redirect to HTTPS. |
| Status code | Was it 200, 301, 302, 401, 403, 404, or 500? | Headers are commonly present on successful pages but missing from redirects and error responses. |
| Response type | Was it HTML, JSON, a file, a static asset, or an empty response? | CSP and frame protection matter primarily for browser-rendered documents, while caching and content type may matter more for APIs. |
| Delivery layer | Which component produced or modified the final response? | The application, reverse proxy, CDN, WAF, gateway, or load balancer may add, remove, duplicate, or overwrite headers. |
| Request method | Did the scanner use GET, HEAD, or another method? | Some platforms return different header sets for HEAD, redirects, health checks, and normal GET requests. |
Quick verification commands
curl -sS -D - -o /dev/null https://example.com/path curl -sS -I https://example.com/path curl -sS -L -D - -o /dev/null http://example.com/path
Use the first command to inspect the real GET response, the second to compare a HEAD response, and the third to view the complete HTTP-to-HTTPS redirect chain. Replace the example URL with the exact scanner target.
How Serious Is a Missing HTTP Security Header?
Severity depends on the missing control, the response type, the application’s exposure, and whether another control already provides equivalent protection. A scanner’s generic rating should be treated as a starting point for triage rather than the final risk decision.
| Situation | Typical priority | Reason |
|---|---|---|
| No HSTS on a public HTTPS login or account site | Medium to high | The browser is not instructed to force future HTTPS connections to the host. |
| No CSP on a complex browser application | Medium | CSP can reduce the impact of some client-side injection paths, but it must be tailored and tested. |
| No frame protection on a sensitive HTML workflow | Medium | The page may be exposed to clickjacking if framing is not otherwise restricted. |
| No nosniff or incorrect Content-Type | Low to medium | The browser may interpret content differently from the server’s declared type. |
| No-store missing on a response containing tokens or highly sensitive account data | Medium | Shared or local caches may retain data longer than intended. |
| X-Frame-Options missing from a JSON-only machine-to-machine API | Often informational | Framing controls do not add meaningful protection to a non-document JSON response. |
Security headers do not replace output encoding, secure coding, authentication, authorization, CSRF protection, object-level access control, API discovery, or runtime monitoring. They are browser and response hardening controls within a broader security model.
Which HTTP Security Headers Matter?
There is no universal bundle for every response. The strongest configuration is the one that matches the content, browser behavior, authentication model, and deployment architecture.
| Header or control | Best fit | Safe implementation guidance |
|---|---|---|
| Strict-Transport-Security | HTTPS hosts | Send only over HTTPS. Start with a controlled max-age; add includeSubDomains or preload only after every affected subdomain is permanently HTTPS-ready. |
| Content-Security-Policy | Browser-rendered HTML | Design a route-aware policy. Begin with Content-Security-Policy-Report-Only, remove unnecessary sources, then enforce after testing. |
| CSP frame-ancestors | HTML pages requiring framing control | Use frame-ancestors 'none' or an explicit allowlist. Keep X-Frame-Options as a compatibility fallback where needed. |
| X-Content-Type-Options | HTML, scripts, styles, downloads, and many API responses | Set to nosniff and return an accurate Content-Type on every resource. |
| Referrer-Policy | Browser-facing pages | strict-origin-when-cross-origin is a practical baseline; use a stricter value when the application does not need referrer detail. |
| Permissions-Policy | Browser documents and embedded content | Disable camera, microphone, geolocation, and other features unless the application genuinely needs them. |
| Cache-Control | Sensitive HTML and API responses | Use no-store for highly sensitive or token-bearing responses. Do not apply it blindly to versioned static assets that should be cached. |
| Secure, HttpOnly, SameSite | Session and authentication cookies | Use Secure on HTTPS, HttpOnly when scripts do not need the cookie, and an appropriate SameSite mode based on legitimate cross-site flows. |
| CORS response headers | Browser cross-origin API access | Allow only required origins, methods, and headers. Never treat CORS as authentication or server-to-server access control. |
Practical baseline for an HTTPS HTML page
Strict-Transport-Security: max-age=31536000 Content-Security-Policy: default-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'self' X-Content-Type-Options: nosniff Referrer-Policy: strict-origin-when-cross-origin Permissions-Policy: camera=(), microphone=(), geolocation=()
This is an example, not a drop-in policy. A real CSP normally needs explicit rules for scripts, styles, fonts, images, frames, and API connections. Test it in report-only mode before enforcement.
Advanced cross-origin isolation headers
Cross-Origin-Opener-Policy, Cross-Origin-Resource-Policy, and Cross-Origin-Embedder-Policy can strengthen isolation for applications that need it, including features that depend on cross-origin isolation. They can also break popups, embedded content, third-party resources, and integrations, so they should be introduced only for a defined requirement and tested as a coordinated policy.
Do APIs Need the Same Security Headers as HTML Pages?
No. Browser-facing APIs still need strong HTTP response controls, but not every browser document header adds value to every JSON response. This distinction helps teams remediate real risk without adding meaningless headers only to satisfy a generic scanner rule.
| Response type | Prioritize | Usually less relevant |
|---|---|---|
| Public HTML page | HSTS, CSP, frame protection, nosniff, Referrer-Policy, Permissions-Policy | no-store unless the page contains sensitive data |
| Authenticated HTML page | All applicable browser controls, secure cookies, and safe cache behavior | Long-lived public caching |
| Browser-consumed JSON API | HTTPS, accurate Content-Type, nosniff, CORS, secure cookies or tokens, safe caching | X-Frame-Options on JSON-only output |
| Machine-to-machine API | TLS, authentication, authorization, content type, cache controls, rate and abuse protection | CSP, Referrer-Policy, Permissions-Policy, and framing controls |
| Redirect or error response | HSTS on HTTPS, consistent central headers, no sensitive leakage | Document-specific policies when no document is rendered |
| Versioned static asset | Correct Content-Type, nosniff, integrity and caching strategy | no-store when the asset is intentionally cacheable |
For APIs, the larger risks are often broken authorization, excessive data exposure, token leakage, unsafe CORS, undocumented endpoints, business logic abuse, and abnormal automated behavior. Headers support the security model, but runtime API visibility and response inspection address different layers of risk.
How to Fix “HTTP Security Header Not Detected”
Add the missing header at the layer that consistently controls the affected response. Centralized configuration is useful for common baselines, while application-level configuration is better when policies differ by route, tenant, authentication state, or response type.
Application
Best for route-aware CSP, cookies, cache controls, and responses whose security policy depends on application logic.
Reverse proxy or web server
Best for a consistent baseline across services when NGINX, OpenResty, Apache, or IIS owns the final response.
Gateway, CDN, or WAF
Useful for centralized enforcement, but verify that it does not overwrite application-specific policies or hide inconsistent backend behavior.
Multiple layers
Avoid duplicate or conflicting values. Define one owner for each header and document intentional exceptions.
NGINX or OpenResty example
add_header Strict-Transport-Security "max-age=31536000" always; add_header X-Content-Type-Options "nosniff" always; add_header X-Frame-Options "SAMEORIGIN" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always; add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
The always parameter helps include headers on non-2xx responses. Configure HSTS only in the HTTPS server context, and test inherited add_header behavior when nested locations define their own headers.
Apache HTTP Server example
Header always set Strict-Transport-Security "max-age=31536000" Header always set X-Content-Type-Options "nosniff" Header always set X-Frame-Options "SAMEORIGIN" Header always set Referrer-Policy "strict-origin-when-cross-origin" Header always set Permissions-Policy "camera=(), microphone=(), geolocation=()"
Enable the headers module, place HSTS only in the TLS virtual host, and confirm that application or proxy responses do not produce duplicate values.
IIS web.config example
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Strict-Transport-Security" value="max-age=31536000" />
<add name="X-Content-Type-Options" value="nosniff" />
<add name="X-Frame-Options" value="SAMEORIGIN" />
<add name="Referrer-Policy" value="strict-origin-when-cross-origin" />
<add name="Permissions-Policy" value="camera=(), microphone=(), geolocation=()" />
</customHeaders>
</httpProtocol>
</system.webServer>For IIS, HSTS can also be managed with platform features or application middleware. Keep it limited to HTTPS and verify inherited site, server, and application settings.
Content Security Policy rollout
Content-Security-Policy-Report-Only: default-src 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'self'
Review violations, add only required sources, remove unsafe exceptions where feasible, test login and payment flows, then replace the report-only header with an enforced Content-Security-Policy.
Testing and Rollout Best Practices
- Reproduce the exact finding. Record the URL, port, protocol, method, status code, and current headers.
- Classify the response. Decide whether it is HTML, JSON, a redirect, an error page, a file, or a static resource.
- Select the control owner. Choose the application, proxy, gateway, CDN, WAF, or load balancer that should own the header.
- Deploy in staging. Test public, authenticated, admin, upload, download, embedded, and error workflows.
- Use report-only deployment where available. CSP and some cross-origin policies need observation before enforcement.
- Inspect the real path. Verify the final response after every intermediary, not only the origin server.
- Retest with multiple methods. Compare GET, HEAD, redirect chains, 4xx, and 5xx responses.
- Monitor after release. Watch browser console reports, application errors, blocked resources, API failures, and repeated scanner alerts.
Common Scanner False Positives and Incomplete Fixes
| Finding pattern | Likely cause | What to verify |
|---|---|---|
| Header appears in the browser but not in the scan | The scanner tested a different hostname, port, route, method, or status code. | Replay the exact scanner request and compare raw response headers. |
| Header exists at the origin but is absent publicly | A CDN, proxy, WAF, or gateway stripped or replaced it. | Inspect both origin and externally delivered responses. |
| Only redirects or errors fail | The configuration applies only to successful responses. | Use NGINX always, Apache Header always, or equivalent platform behavior. |
| HSTS missing on port 80 | The scanner is checking the HTTP listener. | Confirm a clean redirect to HTTPS and verify HSTS on the final HTTPS response. |
| X-Frame-Options missing on JSON | A generic policy expects a document header on a non-document response. | Document why the control is not applicable or use a scanner exception based on response type. |
| Duplicate header values | Multiple layers own the same header. | Assign ownership and remove redundant configuration. |
| CSP is present but the site still has unsafe allowances | The policy was added only to satisfy detection. | Review script sources, nonces or hashes, unsafe-inline, unsafe-eval, framing, and reporting. |
HTTP Security Header Remediation Checklist
- Capture the exact evidence: URL, hostname, port, protocol, method, status code, response type, and missing header.
- Determine applicability: confirm whether the control protects that response type.
- Check for an equivalent control: for example, CSP frame-ancestors may provide framing protection even when X-Frame-Options is absent.
- Assign one owner: application, NGINX/OpenResty, Apache, IIS, gateway, CDN, WAF, or load balancer.
- Stage HSTS: enable it only over HTTPS and delay includeSubDomains or preload until the domain is fully ready.
- Stage CSP: use report-only mode, collect violations, then enforce a tested policy.
- Set accurate content types: pair X-Content-Type-Options: nosniff with correct Content-Type values.
- Protect sensitive responses: use appropriate cache controls and secure cookie attributes.
- Validate redirects and errors: inspect 3xx, 4xx, and 5xx responses as well as normal pages.
- Check the delivery chain: compare origin and public responses for stripping, duplication, or overwrite.
- Retest and document exceptions: close valid gaps and record response-specific non-applicability with evidence.
- Monitor continuously: detect policy drift as applications, gateways, CDNs, and APIs change.
Common mistakes to avoid
- Adding every header to every response without considering whether it applies.
- Using HSTS includeSubDomains or preload before all subdomains are HTTPS-ready.
- Deploying a restrictive CSP directly into enforcement without real workflow testing.
- Adding deprecated X-XSS-Protection guidance copied from old remediation articles.
- Fixing only the homepage while redirects, APIs, management paths, and error pages remain inconsistent.
- Allowing multiple infrastructure layers to create duplicate or conflicting policies.
- Treating headers as a replacement for authorization, secure coding, and runtime API security.
Where Ammune fits
Ammune complements response hardening by discovering live APIs, inspecting requests and responses, identifying sensitive data exposure, detecting abnormal behavior and business logic abuse, and producing SIEM-ready security events. This helps teams see risks that browser security headers cannot address.
Conclusion
An “HTTP security header not detected” alert should lead to a precise response, not a universal header bundle. Reproduce the exact request, identify the missing control, determine whether it applies to that response, configure it at the correct layer, and verify the final result through the production delivery chain.
For browser-rendered pages, HSTS, CSP, frame protection, nosniff, Referrer-Policy, Permissions-Policy, secure cookies, and safe caching can materially improve defense in depth. For APIs, prioritize TLS, accurate content types, CORS where needed, cache and token protection, authentication, authorization, sensitive-data controls, and runtime visibility.
The best outcome is not simply making the scanner green. It is a documented, tested, and maintainable policy that protects each response without breaking the application.
FAQs About HTTP Security Header Not Detected
What does HTTP security header not detected mean?
It means a scanner did not find one or more expected HTTP response security headers on the exact response it tested. The report should identify the affected URL, port, protocol, status code, and missing header.
Is a missing security header always a vulnerability?
No. It can be a meaningful defense-in-depth gap, an incomplete configuration on one path, or a low-value finding where the header does not apply. Risk depends on the header, response type, data sensitivity, and existing controls.
How do I fix HTTP security header not detected?
Reproduce the scanner request, identify the exact missing header, confirm that it applies to the response, add it at the application or infrastructure layer that owns the final response, and retest through the complete delivery path.
Why is the finding reported only on one page or port?
Different virtual hosts, listeners, routes, proxies, status codes, and services can return different headers. A header present on the homepage over port 443 may still be absent from port 80, a management port, an API hostname, a redirect, or an error page.
Should HSTS be returned on HTTP port 80?
Browsers only honor HSTS when it is received over HTTPS. The HTTP listener should normally redirect to HTTPS, while the final HTTPS response should carry the Strict-Transport-Security header.
Should every API response include CSP and X-Frame-Options?
No. CSP and framing controls primarily protect browser-rendered documents. A JSON-only machine-to-machine API usually gains more from TLS, accurate content types, safe caching, authentication, authorization, and response-data controls.
What is the safest way to deploy Content Security Policy?
Start with Content-Security-Policy-Report-Only, collect violations from real workflows, allow only required sources, remove unsafe exceptions where feasible, and enforce the policy after staging and production validation.
Should I add X-XSS-Protection?
Generally no. X-XSS-Protection is deprecated and no longer recommended for modern browsers. Use a well-designed Content Security Policy together with secure coding, output encoding, and framework protections.
Can a reverse proxy or CDN cause a false positive?
Yes. An intermediary can strip, overwrite, cache, or duplicate headers. Compare the origin response with the externally delivered response and test the exact route and status code reported by the scanner.
How do I verify the fix?
Inspect the real GET response and redirect chain with curl or browser developer tools, test 2xx, 3xx, 4xx, and 5xx responses, rerun the original scanner, and confirm that the header value is valid and effective rather than merely present.
Do security headers replace API authorization?
No. Security headers do not prevent broken object-level authorization, excessive data exposure, weak authentication, shadow APIs, or business logic abuse. Those require API-specific design, testing, discovery, and runtime controls.
How does Ammune help beyond HTTP headers?
Ammune discovers APIs, inspects live requests and responses, detects sensitive-data exposure and abnormal behavior, and creates SIEM-ready evidence. These runtime capabilities address API risks that browser response headers do not cover.
Strengthen API security beyond response headers
Ammune helps teams discover APIs, inspect live requests and responses, identify sensitive data exposure, detect abnormal behavior and business logic abuse, and produce SIEM-ready evidence from runtime traffic.
