Potential log injection in development server (runserver) logging
django.core.servers.basehttp.WSGIRequestHandler.log_message()
may emit log records that are not properly escaped or sanitized, making it possible for specially crafted requests to inject terminal escape sequences or misleading log content. This only affects the internal development server (runserver
command). Per the documentation, this server is not intended for production use and has not been security-audited.
Although this is not considered a vulnerability, a fix for defense-in-depth should be applied, also to avoid confusion and future security reports about the same thing. This fix would be in line to what Python does for esacaping.
Thanks to "Kainan Zhang (@4xpl0r3r) from Fortinet" for the report in the security mailing list.
Change History
(10)
Triage Stage: |
Unreviewed → Accepted
|
Description: |
modified (diff)
|
Owner: |
set to YashRaj1506
|
Status: |
new → assigned
|
Patch needs improvement: |
set
|
Patch needs improvement: |
unset
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
I think that an ideal solution would be to use
django.utils.log.log_response()
to implemenetdjango.core.servers.basehttp.WSGIRequestHandler.log_message()
.