CVE-2026-115778
Unbounded Telnet subnegotiation buffer leads to memory exhaustion.
- CVSS 7.5
- CWE-400
- Resource Management
- Remote
Twisted is an event-based framework for internet applications, supporting Python 3.6+. Prior to 26.10.0rc1, twisted.conch.telnet.Telnet.dataReceived appends every byte received after IAC SB to a persistent subnegotiation buffer until IAC SE is received, without applying a maximum length. Telnet option negotiation occurs before authentication, so an unauthenticated peer can omit the terminator and continuously grow the buffer. The resulting memory exhaustion can terminate the process and every service it hosts. This issue is fixed in version 26.10.0rc1.
- CWE
- CWE-400
- CVSS base score
- 7.5
- Published
- 2026-10-23
- OWASP
- A06 Vulnerable and Outdated Components
- Orthogonal defect classification
- Algorithm
- Code defect classification
- Missing Check
- Category
- Resource Management
- Subcategory
- Memory Leaks
- Accessibility scope
- Remote
- Impact
- Denial of Service (DoS)
- Affected component
- Twisted
- Fixed by upgrading
- Yes
Solution
Upgrade Twisted to version 26.10.0rc1 or newer.
Vulnerable code sample
from twisted.conch.telnet import Telnet
from twisted.internet.protocol import Protocol
class EchoTelnet(Telnet):
def __init__(self):
super().__init__()
self._subnegotiation = b''
def dataReceived(self, data):
# VULNERABLE: unbounded growth of subnegotiation buffer
if self.state == 'subnegotiation':
self._subnegotiation += data
if b'\xff\xf0' in self._subnegotiation: # IAC SE
self.handleSubnegotiation(self._subnegotiation)
self._subnegotiation = b''
self.state = 'data'
else:
super().dataReceived(data)
class SimpleProtocol(Protocol):
def connectionMade(self):
self.transport.write(b'Welcome\r\n')Patched code sample
from twisted.conch.telnet import Telnet
from twisted.internet.protocol import Protocol
MAX_SUBNEGOTIATION = 1024 # FIX: limit buffer size to prevent exhaustion
class EchoTelnet(Telnet):
def __init__(self):
super().__init__()
self._subnegotiation = b''
def dataReceived(self, data):
# FIX: enforce maximum subnegotiation buffer length
if self.state == 'subnegotiation':
self._subnegotiation += data
if len(self._subnegotiation) > MAX_SUBNEGOTIATION:
self.transport.loseConnection()
return
if b'\xff\xf0' in self._subnegotiation: # IAC SE
self.handleSubnegotiation(self._subnegotiation)
self._subnegotiation = b''
self.state = 'data'
else:
super().dataReceived(data)
class SimpleProtocol(Protocol):
def connectionMade(self):
self.transport.write(b'Welcome\r\n')Published 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.
- conch.telnet: address review, private cap and drop on overflow (twisted/twisted)
src/twisted/conch/telnet.py,src/twisted/conch/telnet.py · Telnet.dataReceived - conch.telnet: bound the subnegotiation buffer to prevent a memory DoS (Fixes #12706) (twisted/twisted)
src/twisted/conch/telnet.py,src/twisted/conch/telnet.py · Telnet.dataReceived
Cite this entry
@misc{vaitp:cve2026115778,
title = {{Unbounded Telnet subnegotiation buffer leads to memory exhaustion.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-115778},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-115778/}}
}
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 ::
