Skip to main content
InfoCookiesOWASP A05:2021CWE-200

How to fix: Cookie Name Leaks Framework or Language

A cookie named PHPSESSID, JSESSIONID, connect.sid, ASP.NET_SessionId, or similar reveals the server-side framework or language to any observer.

Why it matters

Knowing the server framework allows attackers to target known framework-specific CVEs, default configuration weaknesses, and deserialization vulnerabilities specific to PHP, Java, .NET, or Express.

Framework-specific cookie names are set by default in many web frameworks. Renaming them to generic identifiers removes one fingerprinting vector and slightly raises the bar for automated exploitation tooling that looks for specific cookie names.

How to fix it

  1. 1Configure your session middleware to use a custom, generic cookie name.
  2. 2Prefer the __Host- prefix for session cookies to gain both host-only enforcement and name opacity.

Code examples

Express (custom session name)

JavaScript
import session from 'express-session';

app.use(session({
  name: '__Host-sid', // Not 'express.sid' or 'connect.sid'
  secret: process.env.SESSION_SECRET,
  cookie: { httpOnly: true, secure: true, sameSite: 'lax', path: '/' },
}));

PHP (custom session name)

PHP
session_name('__Host-sid');
session_start();

References

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

See every cookies check

Questions

How severe is Cookie Name Leaks Framework or Language?
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-name-disclosure, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Cookie Name Leaks Framework or Language map to?
It maps to CWE-200. 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 cookie name leaks framework or language

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

Cookie Name Leaks Framework or Language fix | VulnRadar