Miggo Logo

CVE-2025-48432: Django Improper Output Neutralization for Logs vulnerability

4

CVSS Score
3.1

Basic Information

EPSS Score
0.10761%
Published
6/5/2025
Updated
6/6/2025
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
Djangopip>= 5.2, < 5.2.25.2.2
Djangopip>= 5.0a1, < 5.1.105.1.10
Djangopip< 4.2.224.2.22

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability lies in the django.utils.log.log_response function, which is responsible for logging HTTP responses. Prior to the patch, this function directly used the request.path in log messages. Since request.path can be controlled by an attacker (e.g., by crafting a malicious URL), it was possible to inject control characters (like newlines or ANSI escape sequences) into the logs. This could lead to log injection or forgery, where an attacker could manipulate the appearance or structure of the logs, potentially obscuring other attacks or misleading log analysis tools.

The patch addresses this by ensuring that all positional formatting arguments passed to the logger within log_response are escaped using unicode_escape encoding. This sanitizes the input and prevents the injection of control characters.

The runtime indicator for this vulnerability would be the django.utils.log.log_response function appearing in a stack trace or profiler output during the processing of a request that triggers the log injection. The key is that this function handles the request.path and passes it to the logging mechanism. The vulnerability is triggered when a crafted request.path containing control characters is processed by this function and subsequently written to the logs.

Other functions in the tests/logging_tests/tests.py file, such as test_control_chars_escaped, test_async_control_chars_escaped, and test_unicode_escape_escaping, were modified to add test cases for the fix. These functions themselves are not vulnerable but are part of the testing and validation of the mitigation. The core vulnerability resides in django.utils.log.log_response.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*n issu* w*s *is*ov*r** in *j*n*o *.* ***or* *.*.*, *.* ***or* *.*.**, *n* *.* ***or* *.*.**. Int*rn*l *TTP r*spons* lo**in* *o*s not *s**p* r*qu*st.p*t*, w*i** *llows r*mot* *tt**k*rs to pot*nti*lly m*nipul*t* lo* output vi* *r**t** URLs. T*is m*y l

Reasoning

T** vuln*r**ility li*s in t** `*j*n*o.utils.lo*.lo*_r*spons*` *un*tion, w*i** is r*sponsi*l* *or lo**in* *TTP r*spons*s. Prior to t** p*t**, t*is *un*tion *ir**tly us** t** `r*qu*st.p*t*` in lo* m*ss***s. Sin** `r*qu*st.p*t*` **n ** *ontroll** *y *n