Listen to this Post
The vulnerability exists in the `django.core.serializers.xml_serializer.getInnerText()` function within Django’s XML deserialization framework. This function is responsible for extracting text content from XML nodes during deserialization. Due to algorithmic complexity issues, specifically inefficient handling of deeply nested or specially crafted XML elements, the function can exhibit exponential time and memory consumption. An attacker can exploit this by submitting XML data with maliciously structured nested tags or large numbers of elements to an endpoint that uses Django’s XML deserializer. When processed, the `getInnerText()` function recursively traverses the XML tree, and with crafted input, this traversal becomes computationally intensive, leading to CPU exhaustion and excessive memory usage. This results in a denial-of-service condition, rendering the application unresponsive. The vulnerability affects XML deserialization flows, such as those used in API endpoints or data import features that accept XML input. The issue is triggered remotely without authentication, making it accessible to any user who can send XML data to the vulnerable endpoint. The complexity arises from how text nodes are concatenated in deep nesting scenarios, causing repeated operations and resource drain. Patched versions optimize the text extraction algorithm to handle nested structures efficiently, preventing the exploitation.
Platform: Django
Version: 5.2, 5.1, 4.2
Vulnerability: XML DoS
Severity: Moderate
date: Dec 2, 2025
Prediction: Patched available
What Undercode Say:
Analytics
Showing bash commands and codes related to the blog
python -m django --version
Example vulnerable code path
from django.core.serializers import deserialize
data = open('malicious.xml').read()
for obj in deserialize('xml', data): Triggers getInnerText()
pass
how Exploit:
Craft XML with deep nesting or many elements and send to XML deserialization endpoint.
Protection from this CVE
Update to patched versions: 5.2.9, 5.1.15, 4.2.27.
Impact:
CPU and memory exhaustion, leading to denial-of-service.
🎯Let’s Practice Exploiting & Learn Patching For Free:
Sources:
Reported By: github.com
Extra Source Hub:
Undercode

