☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Django logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 4 🐛 CWE-117
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2025-48432

CVE-2025-48432 Log Injection in Django
📅 PUBLISHED: 2025-06-05 00:00 UTC 🔄 UPDATED: 2026-09-23 20:36 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: CONFIRMED — 3+ independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.75%
👁️
0.75% probability
18.8× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Country: USA License: Open Source
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
4.0
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-48432 is a log injection vulnerability in the Django web framework affecting versions prior to 4.2.23, 5.1.11, and 5.2.3. The flaw exists in Django's internal HTTP response logging mechanism, where the request.path value is not properly escaped before being written to logs. An attacker can craft a malicious URL containing newline characters or other control sequences, causing log entries to be manipulated or forged. This can lead to log poisoning, where fake log entries are injected, or log forgery, where legitimate entries are obscured. While the CVSS score is 4.0 (Medium), the impact is primarily on log integrity and downstream log processing systems. No public exploit code or proof-of-concept is currently available.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

Django is a widely used Python web framework distributed via PyPI. This vulnerability affects the core framework itself, not a third-party package. Organizations using Django should treat this as a high-priority update due to the potential for log manipulation, which can hinder incident response and forensic analysis. The fix is available in the patched versions listed above. Ensure that your requirements.txt or Pipfile is updated accordingly.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
  • Base Score: 4.0 (Medium)
  • Attack Vector: Network (AV:N) - The vulnerability can be exploited remotely.
  • Attack Complexity: Low (AC:L) - No special conditions are required.
  • Privileges Required: None (PR:N) - No authentication needed.
  • User Interaction: None (UI:N) - No user action required.
  • Scope: Unchanged (S:U) - The vulnerability does not affect other components.
  • Confidentiality Impact: None (C:N) - No data exposure.
  • Integrity Impact: Low (I:L) - Log entries can be modified or injected.
  • Availability Impact: None (A:N) - No denial of service.

Threat Level: Medium. While the direct impact is limited to log manipulation, this can be leveraged for more sophisticated attacks, such as hiding malicious activity or poisoning log-based monitoring systems.

Deep Dive & Mechanics

The vulnerability resides in Django's internal HTTP response logging, specifically in the django/http/response.py module. When a request is processed, Django logs the response status code and the request path. The request.path attribute is taken directly from the URL without sanitization. An attacker can include characters like \n (newline) or \r (carriage return) in the URL path. When the log entry is written, these characters are interpreted as control sequences, allowing the attacker to break out of the current log line and inject arbitrary content.

For example, a URL like /valid-path%0a%0d[FAKE_LOG_ENTRY] would cause the log to appear as:

[2025-01-01 12:00:00] "GET /valid-path HTTP/1.1" 200
[FAKE_LOG_ENTRY]

This can be used to forge log entries, hide real attacks, or confuse log analysis tools. The vulnerability is particularly dangerous when logs are viewed in terminals (where ANSI escape sequences could be used) or processed by automated systems that parse log files.

Vulnerable vs. Patched Code

Vulnerable Code (Django < 4.2.23, < 5.1.11, < 5.2.3):

# django/http/response.py (simplified)
class HttpResponseBase:
    def __init__(self, *args, **kwargs):
        # ...
        pass

    def _log_response(self, request, response):
        # Vulnerable: request.path is not escaped
        logger.info(
            '"%s %s %s" %s %s',
            request.method,
            request.path,  # <-- Unsanitized input
            request.META.get('SERVER_PROTOCOL', 'HTTP/1.1'),
            response.status_code,
            response.get('Content-Length', 0),
        )

Patched Code (Django 4.2.23, 5.1.11, 5.2.3):

# django/http/response.py (simplified)
import logging

class HttpResponseBase:
    def __init__(self, *args, **kwargs):
        # ...
        pass

    def _log_response(self, request, response):
        # Patched: request.path is now escaped
        logger.info(
            '"%s %s %s" %s %s',
            request.method,
            logging.Formatter.escape(request.path),  # <-- Escaped
            request.META.get('SERVER_PROTOCOL', 'HTTP/1.1'),
            response.status_code,
            response.get('Content-Length', 0),
        )

The fix uses logging.Formatter.escape() to sanitize the request.path before logging, preventing control characters from being interpreted.

Exploitation & Lab Setup

Red Team (Exploitation)

Prerequisites:

  • A target running Django < 4.2.23, < 5.1.11, or < 5.2.3.
  • Network access to the target.

Exploitation Steps:

  1. Identify a Django application (e.g., by checking for csrfmiddlewaretoken in HTML or django in HTTP headers).
  2. Craft a malicious URL containing newline characters and a fake log entry. For example:
    GET /valid-path%0a%0d[2025-01-01 12:00:00] "FAKE_LOG_ENTRY" HTTP/1.1
    Host: target.com
    
  3. Send the request using curl:
    curl -v "http://target.com/valid-path%0a%0d[2025-01-01%2012:00:00]%20\"FAKE_LOG_ENTRY\""
    
  4. Check the server logs (e.g., /var/log/django.log or application.log). The injected content will appear as a separate log entry.

Note: No public exploit code is available. The above is a conceptual demonstration.

Blue Team (Detection & Defense)

Detection:

  • Monitor for URLs containing control characters (%0a, %0d, %00, etc.) in web server logs.
  • Use the detection rules provided in the ## Detection Engineering section.

Defense:

  • Immediately upgrade Django to the patched versions.
  • Implement input validation to reject URLs with control characters at the web server level (e.g., Nginx/Apache).
  • Use a Web Application Firewall (WAF) to block requests with suspicious patterns.
  • Ensure log viewers and parsers are configured to handle control characters safely.

Indicators of Compromise (IOCs)

  • Log Entries: Unexpected newlines or carriage returns in log files.
  • URL Patterns: Requests containing %0a, %0d, %00, or other URL-encoded control characters.
  • Anomalous Log Content: Log entries that appear to be injected, such as fake timestamps or status codes.
  • Network Traffic: HTTP requests with unusual path segments (e.g., /valid-path%0a%0d[FAKE]).

Detection Engineering

YARA Rule

rule CVE_2025_48432_Log_Injection {
    meta:
        description = "Detects log injection attempts targeting Django CVE-2025-48432"
        author = "Valters IT"
        date = "2025-01-01"
        reference = "CVE-2025-48432"
    strings:
        $url_encoded_newline = /%0[aAdD]/
        $url_encoded_cr = /%0[dD]/
        $raw_newline = /\x0a/
        $raw_cr = /\x0d/
    condition:
        any of ($url_encoded_*) or any of ($raw_*)
}

Sigma Rule

title: Django Log Injection Attempt (CVE-2025-48432)
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects attempts to exploit CVE-2025-48432 by injecting control characters into URLs
author: Valters IT
date: 2025-01-01
logsource:
    category: webserver
    product: django
detection:
    selection:
        cs-method: 'GET'
        cs-uri-query|contains:
            - '%0a'
            - '%0d'
            - '%0A'
            - '%0D'
    condition: selection
falsepositives:
    - Legitimate use of encoded characters in URLs (rare)
level: medium

Suricata Rule

alert http any any -> any any (msg:"CVE-2025-48432 Django Log Injection Attempt"; flow:to_server,established; content:"%0a"; http_uri; nocase; sid:1000001; rev:1;)
alert http any any -> any any (msg:"CVE-2025-48432 Django Log Injection Attempt"; flow:to_server,established; content:"%0d"; http_uri; nocase; sid:1000002; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade Django: Update to version 4.2.23, 5.1.11, or 5.2.3 immediately.
    pip install --upgrade django==5.2.3
    
  2. Restart Services: Restart all Django application servers after the upgrade.

Compensating Controls (if patching is delayed):

  • Web Server Filtering: Configure Nginx or Apache to reject URLs containing control characters.
    • Nginx example:
      if ($request_uri ~* "%0[aAdD]|%0[dD]") {
          return 403;
      }
      
  • WAF Rules: Deploy WAF rules to block requests with %0a, %0d, etc.
  • Log Monitoring: Implement real-time monitoring for anomalous log entries.

Long-Term Measures:

  • Adopt secure coding practices to sanitize all user input before logging.
  • Regularly review and update dependencies.
  • Conduct security audits of logging mechanisms.

Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-48432/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.