Cookie Security Flags Checker
Verify that session, JWT, and CSRF cookies issued by your live app enforce HttpOnly, Secure, and SameSite attributes—blocking XSS session theft, plaintext HTTP leaks, and CSRF attacks.
01 · Exact Passive Checks
What LeakRay inspects on your live URL
| Rule ID & Check | What It Inspects | Why It's Passive & Safe |
|---|---|---|
cookie-security-flagsSession Cookie HttpOnly, Secure & SameSite Audit | Parses Set-Cookie headers for session- and auth-named cookies (session, sid, auth, token, jwt, csrf, next-auth, authjs, sb-) and flags any missing HttpOnly, Secure, or SameSite attribute. | Reads only unauthenticated Set-Cookie headers from your public URL and redacts all cookie values before storage. |
https-and-hstsHTTPS & Strict-Transport-Security Enforcement | Verifies HTTPS transport and HSTS configuration so browsers refuse plaintext HTTP downgrades that could leak non-Secure cookies. | Passive HTTP header and redirect inspection only. |
security-headers-coreContent-Security-Policy & XSS Mitigation | Audits CSP and X-Content-Type-Options headers that serve as a second defense layer alongside HttpOnly cookies. | Inspects standard HTTP response headers passively. |
cors-misconfigurationCross-Origin Credentialed CORS Check | Ensures cross-origin requests cannot read authenticated responses using session cookies via reflected Origin + Allow-Credentials. | Benign unauthenticated Origin header probe only. |
02 · Vulnerable vs. Fixed
Common production leak pattern and the exact fix
// Vulnerable: Session cookie set without HttpOnly, Secure, or SameSite
import { cookies } from "next/headers";
export async function createSession(token: string) {
const cookieStore = await cookies();
cookieStore.set("session_token", token, {
path: "/",
// Missing httpOnly (readable via XSS), secure (HTTP leak), and sameSite (CSRF)
});
}// Fixed: Harden session cookie with __Host- prefix, HttpOnly, Secure & SameSite
import { cookies } from "next/headers";
export async function createSession(token: string) {
const cookieStore = await cookies();
const isProd = process.env.NODE_ENV === "production";
cookieStore.set(isProd ? "__Host-session_token" : "session_token", token, {
httpOnly: true,
secure: isProd,
sameSite: "lax",
path: "/",
maxAge: 60 * 60 * 24 * 7,
});
}03 · AI Fix Prompt
Paste into Cursor, Claude Code, Lovable, or Bolt
Harden all session and authentication cookies in my application:
1. Search the codebase for `cookies().set`, `res.cookie(`, `Set-Cookie`, NextAuth/Auth.js cookie configs, and Supabase SSR cookie handlers.
2. Ensure every session, auth, refresh, and token cookie enforces `httpOnly: true`, `secure: process.env.NODE_ENV === "production"`, and `sameSite: "lax"` (or `"strict"` where cross-site OAuth redirects are not needed).
3. Avoid setting `SameSite=None` unless cross-site iframe/third-party embedding is explicitly required (and pair it with `Secure`).
4. Keep non-sensitive UI preference cookies (such as theme toggles) clearly separated from authentication cookies.04 · Developer FAQ
Frequently asked questions
- What do HttpOnly, Secure, and SameSite each protect against?
- HttpOnly blocks client-side JavaScript (document.cookie) from reading the cookie if XSS occurs. Secure ensures the browser only sends the cookie over HTTPS. SameSite=Lax or Strict restricts cross-site cookie transmission to defend against CSRF attacks.
- Will LeakRay flag harmless UI cookies like theme or locale preferences?
- No. LeakRay specifically targets session- and auth-like cookie names (such as session, sid, auth, jwt, token, csrf, next-auth, authjs, and sb-) so harmless client-side theme or preference cookies do not create false-positive noise.
- Should I use SameSite=Lax or SameSite=Strict for login sessions?
- SameSite=Lax is the recommended default for most web apps because it blocks cross-site POST CSRF while still allowing users arriving from external links or OAuth login redirects to stay signed in. Use SameSite=Strict for high-security admin panels.
- Does LeakRay log or store my cookie values in the scan report?
- No. LeakRay only parses the cookie name and attribute flags, immediately redacting the value (for example session_token=****) before creating the finding or persisting the report.
More Passive Scanners
Explore related LeakRay checks
Supabase RLS & Key Exposure Checker
Passively scan your live app for leaked Supabase service_role keys, exposed PostgREST schemas, and missing RLS signals. Zero signup, <15s.
Open scanner Next.js · App Router & Pages Router · Passive AuditNext.js Production Security Scanner
Audit live Next.js apps for __NEXT_DATA__ secret leaks, debug stack traces, exposed source maps, .env files, and missing security headers.
Open scanner JS Bundles · Entropy + Context Validation · Passive AuditLeaked API Key & Frontend Secret Scanner
Scan your live HTML and JavaScript bundles for leaked Stripe, OpenAI, Anthropic, Gemini, AWS, and GitHub keys—without false-positive noise.
Open scanner Server Config · Dotfiles · Passive AuditExposed .env & .git File Checker
Check if your live website publicly exposes /.env, /.git/HEAD, or backup config files. Passive read-only URL scan with instant fixes. Zero signup.
Open scanner Firebase · Firestore · Passive AuditFirebase & Firestore Security Scanner
Passively audit live Firebase apps for leaked Admin SDK keys, exposed .env files, public source maps, and weak security headers without public apiKey noise.
Open scanner Cursor · Lovable · Bolt · v0 · Passive AuditSecurity Scanner for Vibe-Coded Apps
Free pre-launch security check for AI-built apps from Cursor, Claude Code, Lovable, Bolt, and v0. Catch leaked keys, open files, and missing headers.
Open scanner JavaScript Bundles · .js.map · Passive AuditProduction Source Map Exposure Checker
Check if your live Next.js, Vite, or React app publicly exposes .js.map source maps. Passive URL scan with framework-specific fixes and AI prompts.
Open scanner Headers · CORS · Cookies · Passive AuditHTTP Security Headers & CORS Checker
Check HSTS, CSP, SRI, COOP, CORS credential reflection, and cookie flags — plus JS secret & file checks that header-only scanners miss. Zero signup.
Open scanner Git Metadata · /.git/HEAD · Passive AuditExposed .git Directory & Config Checker
Check if your live site publicly serves /.git/HEAD or /.git/config before attackers dump source code and commit history. Passive URL scan, zero signup.
Open scanner CORS · Origin Reflection · Passive AuditCORS Misconfiguration & Reflection Checker
Test your live app for dangerous CORS origin reflection paired with Access-Control-Allow-Credentials: true. Passive read-only check with instant code fixes.
Open scanner GraphQL · __schema · Passive AuditGraphQL Introspection Exposure Checker
Verify whether /graphql or /api/graphql exposes your full __schema to unauthenticated callers in production. Read-only passive scan with Apollo & Yoga fixes.
Open scanner Lovable · Supabase · Vite · Passive AuditLovable App Security & Supabase Scanner
Passive pre-launch security check for Lovable apps: catch leaked Supabase service_role keys, missing RLS signals, public source maps, and missing headers.
Open scanner Bolt.new · Vite · Client Bundles · Passive AuditBolt.new Security & Vite Bundle Scanner
Scan live Bolt.new and Vite apps for VITE_* client bundle leaks, exposed .env files, public .js.map source maps, and BaaS key misconfigurations in <15s.
Open scanner Cursor · Vercel v0 · Next.js · Passive AuditCursor & v0 Next.js Security Scanner
Audit live Next.js apps built with Cursor and Vercel v0 for __NEXT_DATA__ leaks, NEXT_PUBLIC_* secrets, debug routes, source maps, and missing headers.
Open scanner