Allow enabling Django Debug Toolbar via env variable#12921
Allow enabling Django Debug Toolbar via env variable#12921valentijnscholten merged 3 commits intoDefectDojo:bugfixfrom
Conversation
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
|
Conflicts have been resolved. A maintainer will review the pull request shortly. |
48a9c30 to
24ff59e
Compare
|
converted back to draft as it doesn't work "anymore", will investigate. |
fixed |
|
This pull request leaves the Django Debug Toolbar configured to be unconditionally visible (the show_toolbar callback always returns True), so if DJANGO_DEBUG_TOOLBAR_ENABLED is set in a production environment it could expose sensitive debugging information. The issue is in dojo/settings/settings.dist.py where the toolbar visibility is effectively unrestricted.
Potential Information Disclosure via Debug Toolbar in
|
| Vulnerability | Potential Information Disclosure via Debug Toolbar |
|---|---|
| Description | The Django Debug Toolbar is configured to be unconditionally visible if enabled, due to the show_toolbar callback always returning True. This means that if DJANGO_DEBUG_TOOLBAR_ENABLED is set to True in a production environment, sensitive debugging information (such as SQL queries, request/response data, and application settings) could be exposed to any visitor, leading to severe information disclosure. |
django-DefectDojo/dojo/settings/settings.dist.py
Lines 1942 to 1986 in 674c646
All finding details can be found in the DryRun Security Dashboard.
Maffooch
left a comment
There was a problem hiding this comment.
This is a very elegant approach here - great work!
This PR changes the importing of the extra urls for the debug toolbaar a bit to make it work with Django Debug Toolbar 6.0.0.
The debug toolbar is now also included by default in
settings.dist.py, but in disabled state.It can be enabled by setting `` to
True. It's disabled by default, except when running in dev mode. Hopefully every PR author from now on will check the toolbar for any adverse performance effects :-)