How to fix: Cookie Missing Secure Attribute
A cookie was set without the Secure attribute. Without Secure, the browser will send the cookie over both HTTP and HTTPS connections, exposing it to network interception.
Why it matters
An on-path attacker who can intercept plain HTTP traffic (Wi-Fi eavesdropping, SSRF, HTTP downgrade) receives the cookie in cleartext and can hijack the user's session.
The Secure attribute instructs the browser to transmit the cookie only over HTTPS connections. Without it, the cookie is also sent over plain HTTP. Even if the site enforces HTTPS via HSTS, mixed-content resources or HTTP redirects before HSTS kicks in can expose the cookie.
How to fix it
- 1Add the Secure attribute to all cookies that carry session or authentication data.
- 2Prefer the __Host- or __Secure- prefix to enforce Secure at the browser level.
- 3Ensure the site is fully HTTPS and HSTS is configured.
Code examples
Set-Cookie with Secure
Set-Cookie: session=abc123; HttpOnly; Secure; SameSite=Lax; Path=/Node.js response.cookie()
res.cookie('session', token, {
httpOnly: true,
secure: process.env.NODE_ENV === 'production',
sameSite: 'lax',
path: '/',
});References
Detected automatically by VulnRadar. The check id is cookie-secure-missing, stable across every scan so you can filter or diff on it.
More cookies checks
- LowCookie Domain Attribute Is Too Broad
- InfoThird-Party Cookie Missing Partitioned Attribute
- High__Host- Prefix Cookie Missing Secure Attribute
- High__Host- Prefix Cookie with Non-Root Path
- High__Secure- Prefix Cookie Missing Secure Attribute
- LowCookie Expires/Max-Age Exceeds 1 Year
- InfoCookie Name Leaks Framework or Language
- MediumCookie Path Crosses Application Boundary
Questions
- How severe is Cookie Missing Secure Attribute?
- VulnRadar rates this low 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-secure-missing, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does Cookie Missing Secure Attribute 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.