Skip to main content
InfoCookiesOWASP A05:2021CWE-614

How to fix: Sensitive Cookie Without __Secure- or __Host- Prefix

A session or authentication cookie is set without using the __Host- or __Secure- cookie prefix. These prefixes provide browser-enforced security guarantees beyond what the Secure flag alone offers.

Why it matters

Without a security prefix, attributes like Secure, Path=/, and no Domain= are self-declared but not enforced by the browser. A subdomain that sets the same cookie name without Secure can override the parent domain's cookie.

Cookie prefixes are a defense-in-depth mechanism. __Host- guarantees (at the browser level) that the cookie: was set over HTTPS, is only sent to the exact host, has Path=/, and was not set with a Domain= attribute. These properties cannot be overridden by a subdomain or HTTP response.

How to fix it

  1. 1Rename session and auth cookies with the __Host- prefix.
  2. 2Remove Domain= attribute; __Host- is always host-only.
  3. 3Verify the site is HTTPS-only before deploying __Host- cookies.

Code examples

__Host- prefixed session cookie

HTTP
Set-Cookie: __Host-session=abc123; HttpOnly; Secure; SameSite=Lax; Path=/

References

Detected automatically by VulnRadar. The check id is cookie-no-secure-prefix, stable across every scan so you can filter or diff on it.

See every cookies check

Questions

How severe is Sensitive Cookie Without __Secure- or __Host- Prefix?
VulnRadar rates this info severity in the cookies category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id cookie-no-secure-prefix, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Sensitive Cookie Without __Secure- or __Host- Prefix map to?
It maps to CWE-614. In the OWASP Top 10 it falls under A05:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for sensitive cookie without __secure- or __host- prefix

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

Sensitive Cookie Without __Secure- or __Host- Prefix | VulnRadar