CVE-2026-115775
Unauthenticated XMPP stream can keep elements open, causing unlimited memory growth.
- CVSS 8.7
- CWE-400
- Resource Management
- Remote
Twisted is an event-based framework for internet applications, supporting Python 3.6+. Prior to 26.10.0rc1, the twisted.words.xish.domish ExpatElementStream parser allows an unauthenticated remote peer to keep a container element open while continuously adding child elements. The parser retains the unfinished stanza as an in-memory tree without a byte or element-count limit, and XMPP pre-authentication stream parsing exposes this behavior before credentials are accepted. A single connection can therefore exhaust server memory and terminate the process. This issue is fixed in version 26.10.0rc1.
- CWE
- CWE-400
- CVSS base score
- 8.7
- Published
- 2026-10-23
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Timing/Serialization
- Code defect classification
- Missing Check
- Category
- Resource Management
- Subcategory
- Resource Exhaustion
- Accessibility scope
- Remote
- Impact
- Denial of Service (DoS)
- Affected component
- Twisted
- Fixed by upgrading
- Yes
Solution
Upgrade Twisted to version 26.10.0rc1 or later.
Vulnerable code sample
from twisted.words.xish import domish
from twisted.internet import protocol, reactor
class XMPPProtocol(protocol.Protocol):
def connectionMade(self):
self.stream = domish.ExpatElementStream()
self.stream.DocumentStartEvent = self.document_start
self.stream.ElementEvent = self.handle_element
self.transport.registerProducer(self, streaming=False)
def dataReceived(self, data):
# VULNERABLE: unlimited accumulation of unfinished stanzas
self.stream.feed(data)
def document_start(self, root):
self.root = root
def handle_element(self, element):
# process element after authentication (placeholder)
passPatched code sample
from twisted.words.xish import domish
from twisted.internet import protocol, reactor
MAX_UNFINISHED_ELEMENTS = 1000 # FIX: bound in‑memory tree size
class XMPPProtocol(protocol.Protocol):
def connectionMade(self):
self.stream = domish.ExpatElementStream()
self.stream.DocumentStartEvent = self.document_start
self.stream.ElementEvent = self.handle_element
self.transport.registerProducer(self, streaming=False)
def dataReceived(self, data):
# FIX: enforce limit on unfinished stanza elements
self.stream.feed(data)
if hasattr(self.stream, 'currentElement') and \
getattr(self.stream.currentElement, 'children', None) is not None:
if len(self.stream.currentElement.children) > MAX_UNFINISHED_ELEMENTS:
self.transport.loseConnection()
raise RuntimeError("Exceeded maximum unfinished elements")
def document_start(self, root):
self.root = root
def handle_element(self, element):
# process element after authentication (placeholder)
passPublished fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- words.xish.domish: bound stanza size and element count to prevent a memory DoS (Fixes #12707) (twisted/twisted)
src/twisted/words/xish/domish.py,src/twisted/words/xish/domish.py · ExpatElementStream.parse,src/twisted/words/xish/domish.py · ExpatElementStream._onEndElement,src/twisted/words/xish/domish.py · ExpatElementStream._onStartElement,src/twisted/words/xish/domish.py · ExpatElementStream.__init__,src/twisted/words/xish/domish.py · SuxElementStream.gotTagEnd,src/twisted/words/xish/domish.py · SuxElementStream.gotTagStart,src/twisted/words/xish/domish.py · SuxElementStream.parse,src/twisted/words/xish/domish.py · SuxElementStream.__init__
Cite this entry
@misc{vaitp:cve2026115775,
title = {{Unauthenticated XMPP stream can keep elements open, causing unlimited memory growth.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-115775},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-115775/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
