CVE-2026-85494
Improper length handling and resource mis‑initialization causing crashes and DoS in Apache Thrift.
- CVSS 8.7
- CWE-130
- Resource Management
- Remote
Improper handling of length parameter inconsistency, Uncaught exception, Inefficient Algorithmic Complexity, Memory allocation with excessive size value, Initialization of a resource with an insecure default vulnerability in Apache Thrift Python, Ruby, Erlang, Lua, Dart, JavaME, Perl, PHP and D language bindings. This issue affects Apache Thrift: before 0.25.0. Users are recommended to upgrade to version 0.25.0, which fixes the issue.
- CWE
- CWE-130
- CVSS base score
- 8.7
- Published
- 2026-10-02
- OWASP
- A04 Insecure Design
- Orthogonal defect classification
- Algorithm
- Code defect classification
- Incorrect Algorithm
- Category
- Resource Management
- Subcategory
- Resource Exhaustion
- Accessibility scope
- Remote
- Impact
- Denial of Service (DoS)
- Affected component
- Apache Thrift
- Fixed by upgrading
- Yes
Solution
Upgrade Apache Thrift to version 0.25.0.
Vulnerable code sample
from thrift.transport import TTransport
import struct
def read_message(transport: TTransport.TTransportBase):
# Read 4‑byte length prefix
length_bytes = transport.read(4)
if len(length_bytes) < 4:
raise EOFError("Incomplete length header")
# VULNERABLE: unchecked length leads to excessive memory allocation
msg_len = struct.unpack('!I', length_bytes)[0]
payload = transport.read(msg_len) # may allocate huge buffer
buf = TTransport.TMemoryBuffer(payload)
return buf.read()Patched code sample
from thrift.transport import TTransport
import struct
MAX_MESSAGE_SIZE = 16 * 1024 * 1024 # 16 MiB limit
def read_message(transport: TTransport.TTransportBase):
# Read 4‑byte length prefix
length_bytes = transport.read(4)
if len(length_bytes) < 4:
raise EOFError("Incomplete length header")
# FIX: enforce upper bound on length to prevent resource exhaustion
msg_len = struct.unpack('!I', length_bytes)[0]
if msg_len > MAX_MESSAGE_SIZE:
raise ValueError(f"Message length {msg_len} exceeds allowed maximum")
payload = transport.read(msg_len)
buf = TTransport.TMemoryBuffer(payload)
return buf.read()Cite this entry
@misc{vaitp:cve202685494,
title = {{Improper length handling and resource mis‑initialization causing crashes and DoS in Apache Thrift.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-85494},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-85494/}}
}
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 ::
