Skip to main content
MediumCookies

How to fix: Cookie Path Crosses Application Boundary

A cookie with Path=/ is accessible to every route on the host, including routes served by different applications (e.g., /admin, /api, /blog). This broadens the cookie's exposure across trust boundaries.

Why it matters

An XSS vulnerability in a low-privilege application route (e.g., /blog) can steal session cookies intended only for /admin because all routes share the same cookie jar with Path=/.

Path=/ makes the cookie available to every route on the host. When a server runs multiple applications under different path prefixes, this means a cookie from one application is sent to all others, widening the XSS blast radius.

How to fix it

  1. 1Set the narrowest Path that the application actually needs.
  2. 2Use Path=/admin for admin-only cookies, Path=/api for API tokens, etc.
  3. 3For cookies that genuinely must be site-wide, ensure all paths enforce the same security controls.

Code examples

Narrowly scoped path

HTTP
Set-Cookie: admin-session=abc123; HttpOnly; Secure; SameSite=Strict; Path=/admin

References

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

See every cookies check

Questions

How severe is Cookie Path Crosses Application Boundary?
VulnRadar rates this medium 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-path-cross-app, which stays the same between runs so you can filter, diff, or gate CI on it.

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 path crosses application boundary

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 Path Crosses Application Boundary fix | VulnRadar