The vulnerability lies in the django.core.serializers.xml_serializer.getInnerText() function, which has an algorithmic complexity issue. The function uses list.extend() on a string returned from a recursive call. In Python, using extend with a string as an argument causes the string to be treated as an iterable, and each character is appended to the list individually. For deeply nested XML structures, this results in a quadratic number of operations, leading to excessive CPU and memory consumption and a denial-of-service vulnerability.
The patch rectifies this by introducing a helper function, getInnerTextList, which returns a list of strings. The extend method now operates on this list, which is an efficient operation. The final string is then constructed by joining the elements of the list in the getInnerText function. This change reduces the complexity to linear.
The Deserializer.__next__ method is the starting point of the exploitation chain. It parses the XML input and calls other methods that eventually use the vulnerable getInnerText function. Therefore, both getInnerText and Deserializer.__next__ are critical functions to monitor.