Skip to main content
Vulnerability Database/CVE-2026-66858

CVE-2026-66858: Apache Thrift Protocol DOS Vulnerability

CVE-2026-66858 is a denial of service vulnerability in Apache Thrift that allows stack exhaustion through deeply nested unknown fields in protocol bindings. This article covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-66858 Overview

CVE-2026-66858 affects Apache Thrift, a widely deployed cross-language RPC framework. The protocol skip routine in several Thrift language bindings fails to enforce the configured recursion limit when processing unknown fields. An attacker can send a crafted message that nests unknown fields deeply enough to exhaust the process stack, causing a denial-of-service condition. Affected components include the Python C++ accelerator, the PHP library and its thrift_protocol extension, and the Perl, Lua, Smalltalk, and OCaml libraries. The pure-Python protocol implementations are not affected. The flaw is tracked under CWE-674: Uncontrolled Recursion.

Critical Impact

Unauthenticated remote attackers can crash services that deserialize untrusted Thrift messages by sending a single payload with deeply nested unknown fields.

Affected Products

  • Apache Thrift Python C++ accelerator (versions before 0.25.0)
  • Apache Thrift PHP library and thrift_protocol extension (versions before 0.25.0)
  • Apache Thrift Perl, Lua, Smalltalk, and OCaml libraries (versions before 0.25.0)

Discovery Timeline

  • 2026-10-02 - CVE-2026-66858 published to NVD
  • 2026-10-02 - Last updated in NVD database

Technical Details for CVE-2026-66858

Vulnerability Analysis

Apache Thrift serializes structured data for RPC calls across many languages. When a deserializer encounters a field it does not recognize, it invokes a protocol skip routine to advance past the unknown data. For complex types such as structs, lists, maps, and sets, skip recurses into contained elements to walk the full subtree.

The affected bindings implement a recursion limit for the main read path but neglect to apply the same limit inside skip. An attacker who controls the serialized input can nest unknown-field containers to arbitrary depth. Each level consumes a native stack frame, and sufficiently deep nesting exhausts the stack and terminates the process.

Because Thrift servers typically accept binary payloads without parsing them until the field tag is reached, the condition triggers before authentication in most deployments. The result is a reliable crash primitive against any exposed Thrift endpoint using an affected binding.

Root Cause

The root cause is an inconsistent application of the binding's recursion_limit configuration. The field read path enforces the limit, but the parallel skip code path tracks nested structures using native recursion without checking the depth counter. This is a classic uncontrolled recursion defect [CWE-674].

Attack Vector

Attack delivery requires only network access to a service that accepts Thrift messages. No authentication, user interaction, or prior knowledge of the schema is required. The attacker constructs a message whose top-level field tag is unknown to the server, then nests container types inside that field to a depth exceeding the stack size. On receipt, the server invokes skip, which recurses until the thread's stack is exhausted and the process terminates. The vulnerability does not permit code execution or information disclosure; the impact is confined to availability.

See the Apache Security Mailing List Discussion and the Apache Security Vulnerability Thread for upstream details.

Detection Methods for CVE-2026-66858

Indicators of Compromise

  • Unexpected crashes or segmentation faults in Thrift server processes with no corresponding application error log entries.
  • Repeated short-lived TCP connections from a single source immediately followed by process termination.
  • Core dumps showing extremely deep stack traces inside Thrift skip or protocol-read functions.

Detection Strategies

  • Inspect Thrift message payloads at the network edge for abnormally long sequences of nested container type bytes under unknown field IDs.
  • Enable crash reporting and watchdog restart telemetry on all services using affected Thrift bindings and alert on repeated crashes.
  • Correlate process-exit events with inbound connection metadata to identify sources sending malformed payloads.

Monitoring Recommendations

  • Monitor service availability metrics (restarts, 5xx rates, dropped RPC counts) for Thrift-based services and alert on sudden spikes.
  • Capture and retain core dumps from Thrift workers for forensic analysis of attempted exploitation.
  • Track inbound traffic patterns to Thrift listener ports and flag sources that trigger multiple parse failures or crashes.

How to Mitigate CVE-2026-66858

Immediate Actions Required

  • Upgrade all Apache Thrift bindings to version 0.25.0 or later, which enforces the recursion limit inside the skip routine.
  • Inventory services that embed the Python C++ accelerator, PHP thrift_protocol extension, or the Perl, Lua, Smalltalk, or OCaml libraries and prioritize patching internet-exposed endpoints.
  • Restrict network access to Thrift services so that only trusted clients can reach them until patching is complete.

Patch Information

Apache has released Apache Thrift 0.25.0, which applies the binding's recursion limit to the protocol skip routine. Users should upgrade to this version. Pure-Python protocol users are not affected and do not require action beyond standard dependency hygiene. Patch details are referenced in the Apache Security Mailing List Discussion.

Workarounds

  • Switch Python deployments from the C++ accelerator to the pure-Python protocol implementation, which is not affected.
  • Place a reverse proxy or application gateway in front of Thrift endpoints to enforce maximum message size and reject payloads above a conservative size threshold.
  • Require mutual TLS or network-level authentication on Thrift listeners to prevent unauthenticated attackers from reaching the parser.

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.