# Which security headers should my app send?

> Short answer: add a tested response-header baseline at the host, beginning with HTTPS, content type, referrer, and framing protections. This guide explains what to verify and what the public scan cannot prove, without logging in, changing records, or treating an inconclusive response as a pass.

## What the missing security headers check covers

Security headers are browser instructions delivered with an HTTP response. Missing headers do not always mean an exploitable bug, but they can remove useful defenses against framing, content sniffing, and unsafe resource loading.

The finding describes a public condition, not proof that someone has abused it. First preserve the relevant deployment details, then rotate exposed credentials or close the access path before investigating billing, logs, or affected records.

Inspect the final response after redirects, not a meta tag or a framework setting that may not reach the host. Static assets, API routes, and error responses can use different configuration paths.

## Understand the evidence before changing code

Start with headers appropriate to the app: HSTS only after HTTPS is reliable, nosniff, a deliberate Referrer-Policy, and frame protection. A full Content-Security-Policy needs testing against the app's scripts and payment flows.

Severity reflects potential impact and reach, not certainty of exploitation. A public key can be intentionally visible; the important distinction is what the provider allows that key to do and which server-side policy still applies.

## Apply the narrow, safe change

Set headers in the deployment layer or framework response configuration. Begin CSP in report-only mode, review violations, and avoid copying a restrictive script policy that silently breaks sign-in or checkout.

Conservative host header example:

```json
{
  "key": "X-Content-Type-Options",
  "value": "nosniff"
}

{
  "key": "Referrer-Policy",
  "value": "strict-origin-when-cross-origin"
}
```

Prefer the smallest repair that restores the intended boundary. Keep public client configuration public, move privileged operations behind an authenticated server route, and make data rules depend on the authenticated owner or an explicit role.

## Verify the production result

After deployment, inspect response headers on the homepage and a representative route. Confirm HTTPS redirects correctly, existing integrations still work, and the browser does not report blocked required assets.

Use the snippet as a starting point, not a blind migration. Confirm the real table, environment, route, identity claim, and deployment platform first; a copied policy with the wrong owner field can block legitimate users or expose the wrong records.

## Keep the issue from returning

Keep a small security-header test in deployment checks and assign an owner for policy changes. Revisit CSP when adding scripts, analytics, authentication providers, or payment components.

Verify the repair from the same public vantage point that exposed it. Check the deployed response, confirm the finding is gone, and test the intended signed-in user and an unrelated user through the normal application flow.

## Limits and next steps

A header checker cannot evaluate the full policy's compatibility or prove the application is safe from every browser attack. Review the actual response and app behavior together.

Prevent recurrence with a reviewed migration, a secret scanner, and a small regression test that runs before deploy. Store only the minimum required credential, scope it to one project, and define who can rotate it.

A public scanner cannot establish whether private records were accessed or whether an account was compromised. If a real secret shipped, revoke it with the provider and review the provider's usage and audit history.

## FAQ

**Can a clean missing security headers check prove the app is secure?**

No. It is evidence about the advertised public surface only. Missing headers are defense gaps; severity depends on the header and app context.

**What should I do first if the finding is real?**

Add a safe baseline, then test CSP in report-only mode before enforcing it.

**Does ProofForge change application data?**

No. The scan is read-only and does not sign in, write records, or use a discovered secret. You make and review any remediation in your own project.

**What should I do after the repair?**

Inspect headers after redirects on production pages and assets.

## Key facts

- HSTS should be enabled only when the domain is reliably HTTPS.
- CSP frame-ancestors must be sent as a response header.
- A restrictive script-src policy can break legitimate app integrations.

## Sources

- [owasp.org](https://owasp.org/www-project-secure-headers/)
- [developer.mozilla.org](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers)

## Related

- https://proofforge.live/fix
- https://proofforge.live/tools
- https://proofforge.live/check
- https://proofforge.live/methodology

---
Last updated 2026-11-25 · Reviewed by ProofForge. Methodology: https://proofforge.live/methodology. Scan your app: https://proofforge.live/
