All rules →
Rules / JavaScript / TypeScript
SHIELD-JS-022

Cookie set without HttpOnly/Secure flags

mediumJavaScript / TypeScriptCWE-1004CVSS 5.3

What it detects

A session/auth cookie without httpOnly is readable by XSS; without secure it is sent over plaintext HTTP.

How to fix

Set httpOnly, secure and sameSite flags on session/auth cookies (res.cookie(name, val, { httpOnly: true, secure: true })).

Scan your repo freeFull documentation
Back to all rules
SHIELD-JS-022: Cookie set without HttpOnly/Secure flags — Zennoxa Shield