Skip to content

Sanitize RequestPanel data behind a setting #2074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tim-schilling opened this issue Feb 9, 2025 · 0 comments · Fixed by #2105
Closed

Sanitize RequestPanel data behind a setting #2074

tim-schilling opened this issue Feb 9, 2025 · 0 comments · Fixed by #2105

Comments

@tim-schilling
Copy link
Member

We should sanitize the RequestPanel stats behind a setting. This would prevent us from storing passwords from monitored /login/ requests and other sensitive data. While this isn't a major concern while the toolbar runs in memory, when we start storing data this becomes a big concern.

This is somewhat related to #2048 (comment). See https://github.com/django/django/blob/main/django/views/debug.py#L115-L130 for an example on how to do this.

@dr-rompecabezas dr-rompecabezas self-assigned this Mar 6, 2025
dr-rompecabezas added a commit to dr-rompecabezas/django-debug-toolbar that referenced this issue Mar 12, 2025
- Added `SANITIZE_REQUEST_DATA` setting to control sanitization of
  request data.
- Implemented `sanitize_value` function to sanitize sensitive data based
  on key patterns.
- Updated `get_sorted_request_variable` to support sanitization.
- Added tests for sanitization of GET, POST, cookies, and session data.
- Updated documentation to include new settings.

django-commons#2074
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment