Cyber Security News

Django App Vulnerabilities Allow Remote Code Execution

Security researchers have uncovered severe vulnerabilities in Django that could allow attackers to execute arbitrary code on affected systems.

These flaws, ranging from directory traversal to log injection, highlight critical security risks in one of Python’s most popular web frameworks.

Recent Security Advisories

Django’s security team addressed multiple vulnerabilities in 2025:

  • CVE-2025-48432 (June 2025): Allows log injection via unescaped request paths, enabling attackers to corrupt logs or mask malicious activity. Patched in Django 5.2.3, 5.1.11, and 4.2.23.
  • Denial-of-Service vulnerabilities:
    • strip_tags() DoS (May 2025)
    • Windows-specific DoS in authentication views (April 2025)
    • IPv6 validation DoS (January 2025)

Exploit Chain: Directory Traversal to RCE

A researcher recently demonstrated how chaining vulnerabilities enables remote code execution:

  1. Path Traversal: Manipulating the username field allowed writing files to arbitrary locations (e.g., ../../../../../../app/backend/backend/).
  2. CSV Payload Injection: Malicious Python code embedded in CSV comments survived pandas processing:
# VALID CSV DATA

import os,requests;...application = get_wsgi_application();,,,,,

Python’s interpreter ignored trailing commas added during CSV serialization, preserving the payload.

3. WSGI Hijacking: Overwriting wsgi.py triggered code execution when Django reloaded the file, enabling commands like:

whoami && id && hostname

Mitigation Strategies

  1. Immediate Patching: Upgrade to Django 5.2.3+ or apply security patches for CVE-2025-48432.
  2. Input Sanitization:
def sanitize_filename(filename):
    filename = os.path.basename(filename)
    return os.path.normpath(filename)
  1. File Validation:
class SafeFileValidator:
    def __call__(self, value):
        if '../' in value:
            raise ValidationError('Invalid file name')

The Django project has released patches in versions 5.2.3, 5.1.11, and 4.2.23 to address this vulnerability.

All users running affected versions are strongly advised to upgrade as soon as possible.

As a temporary measure, organizations can implement manual log sanitization or additional validation for log entries, but applying the official patch remains the most effective solution.

These vulnerabilities underscore the critical need for rigorous input validation and prompt patching in Django deployments. Administrators should prioritize reviewing file-handling logic and authentication mechanisms.

Find this News Interesting! Follow us on Google News, LinkedIn, and X to Get Instant Updates

Divya

Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Recent Posts

Hackers Use ConnectWise SkyKick Credentials to Access Microsoft 365, Halting Cloud Backups

Attackers abused compromised ConnectWise Cloud Backup credentials to access Microsoft 365 customer environments, prompting ConnectWise…

1 day ago

Anthropic’s Claude AI Uncovers Origins of NSA-Provided Cryptographic Keys After 25 Years

Anthropic says an internal Claude research model reconstructed how the National Security Agency generated seeds…

2 days ago

Critical WordPress Flaws Allow Attackers to Execute Remote Code Without Authentication

Two WordPress Core vulnerabilities can be chained to execute remote code without authentication, according to…

2 days ago

OpenBSD Kernel Flaw Dating Back 37 Years Enables Local Privilege Escalation to Root

A newly disclosed OpenBSD kernel exploitation chain combines a shared memory accounting flaw with a…

2 days ago

GhostAction Hackers Hide Credential-Stealing Malware in Fake Font Files Across 94 GitHub Repositories

GhostAction attackers have expanded their GitHub credential theft campaign with a second stage that disguises…

2 days ago

SideCopy Hackers Target Indian Organizations With ReverseRAT Malware to Steal Data

Indian authorities have warned that SideCopy hackers are targeting Indian organizations, including academic institutions, with…

2 days ago