How to fix: Django technical 500 debug page exposed
A Django debug error page (yellow screen) is visible, indicating DEBUG=True in the production environment.
Why it matters
Django debug pages expose full Python tracebacks with every local variable at each stack frame, all Django settings (including SECRET_KEY if it appears in a traceback), and installed apps: a critical information disclosure.
DEBUG = True must never be used in production. It enables verbose error pages and can expose SECRET_KEY and database credentials via traceback local variables.
How to fix it
- 1Set DEBUG = False in production settings
- 2Set ALLOWED_HOSTS to your actual domain names
- 3Configure a proper error logging backend (Sentry, logging module)
Code examples
settings/production.py
DEBUG = False
ALLOWED_HOSTS = ["yoursite.com", "www.yoursite.com"]
LOGGING = {
"version": 1,
"handlers": { "file": { "class": "logging.FileHandler", "filename": "/var/log/django.log" } },
"root": { "handlers": ["file"], "level": "WARNING" },
}References
Detected automatically by VulnRadar. The check id is django-debug-page-exposure, stable across every scan so you can filter or diff on it.
More info disclosure checks
- MediumRails Session Cookie Missing HttpOnly Flag
- InfoServer header truncated
- InfoPHP session cookie naming exposes runtime
- Infoconfig.js / settings.js referenced (verify contents)
- Infoenv.js / environment.js referenced (verify contents)
- InfoSitemap.xml publicly accessible
- InfoOpenAPI schema version exposed in URL
- LowCORS exposes internal CDN hostname
Questions
- How severe is Django technical 500 debug page exposed?
- VulnRadar rates this critical severity in the info disclosure 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 django-debug-page-exposure, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does Django technical 500 debug page 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.