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
- 1Disable debug mode in production: APP_DEBUG=false in .env.prod.
- 2Remove WebProfilerBundle from production: it should be in require-dev only.
- 3Set APP_ENV=prod which disables the profiler automatically.
- 4Verify: curl -I https://yoursite.com, no X-Debug-Token header should appear.
Code examples
Production Symfony .env
# .env.prod
APP_ENV=prod
APP_DEBUG=false
# composer install --no-dev in productionReferences
Detected automatically by VulnRadar. The check id is symfony-debug-token, stable across every scan so you can filter or diff on it.
More host validation checks
- HighHost Header Injection Risk
- HighHTTP Request Smuggling Indicator
- HighHTTP Basic Authentication Over Non-HTTPS
- MediumASP.NET ViewState Without MAC Protection
- HighCache Poisoning via Unkeyed Headers
- LowSequential Numeric ID in URL (IDOR Risk)
- HighConfirmed Open Redirect via Location Header
- HighConfirmed Open Redirect via Meta Refresh
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.