Skip to main content
MediumHost validationOWASP A05:2021CWE-489

How to fix: Symfony Debug Token Header Exposed

The X-Debug-Token or X-Debug-Token-Link header is present in the response. These headers indicate Symfony's debug profiler is active in production, exposing full request data, database queries, and application internals.

Why it matters

The Symfony profiler exposes the complete request/response cycle, environment variables, database queries with parameters, and application configuration. An attacker using the debug token link can access a full profiler UI with all this data.

Symfony's WebProfilerBundle adds X-Debug-Token and X-Debug-Token-Link headers in debug mode. The token link provides access to the profiler UI at /_profiler/{token}, exposing sensitive internals.

How to fix it

  1. 1Disable debug mode in production: APP_DEBUG=false in .env.prod.
  2. 2Remove WebProfilerBundle from production: it should be in require-dev only.
  3. 3Set APP_ENV=prod which disables the profiler automatically.
  4. 4Verify: curl -I https://yoursite.com, no X-Debug-Token header should appear.

Code examples

Production Symfony .env

bash
# .env.prod
APP_ENV=prod
APP_DEBUG=false
# composer install --no-dev in production

References

Detected automatically by VulnRadar. The check id is symfony-debug-token, stable across every scan so you can filter or diff on it.

See every host validation check

Questions

How severe is Symfony Debug Token Header Exposed?
VulnRadar rates this medium severity in the host validation 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 symfony-debug-token, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Symfony Debug Token Header Exposed map to?
It maps to CWE-489. 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 symfony debug token header exposed

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

How to fix: Symfony Debug Token Header Exposed | VulnRadar