VAITP Dataset

← Back to the dataset

CVE-2026-94654

Infinite loop in Apache Thrift Python bindings before v0.25.0.

  • CVSS 8.2
  • CWE-835
  • Resource Management
  • Remote

Loop with unreachable exit condition ('infinite loop') vulnerability in Apache Thrift python bindings. This issue affects Apache Thrift: before 0.25.0. Users are recommended to upgrade to version 0.25.0, which fixes the issue.

CVSS base score
8.2
Published
2026-10-02
OWASP
A06 Vulnerable and Outdated Components
Orthogonal defect classification
Timing/Serialization
Code defect classification
Timing Issues
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

import sys
from thrift.transport import TSocket
from thrift.protocol import TBinaryProtocol

def process_requests(host: str, port: int):
    # VULNERABLE: infinite loop waiting for data that never arrives
    transport = TSocket.TSocket(host, port)
    transport.open()
    protocol = TBinaryProtocol.TBinaryProtocol(transport)

    while transport.peek() != b'':
        # read a message header (placeholder)
        header = protocol.readMessageBegin()
        # handle request (omitted)
        protocol.readMessageEnd()
    transport.close()

Patched code sample

import sys
from thrift.transport import TSocket
from thrift.protocol import TBinaryProtocol

def process_requests(host: str, port: int):
    # FIX: break loop when no data is received
    transport = TSocket.TSocket(host, port)
    transport.open()
    protocol = TBinaryProtocol.TBinaryProtocol(transport)

    while True:
        data = transport.read(1)
        if not data:
            break
        # put the byte back for protocol parsing
        transport.cstringio_buf = data + transport.cstringio_buf
        header = protocol.readMessageBegin()
        protocol.readMessageEnd()
    transport.close()

Cite this entry

@misc{vaitp:cve202694654,
  title        = {{Infinite loop in Apache Thrift Python bindings before v0.25.0.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-94654},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-94654/}}
}

Download this entry as JSON Download the whole dataset

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 ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.