CVE-2026-49158 Overview
CVE-2026-49158 is a data amplification vulnerability in the Ruby bindings of Apache Thrift. The flaw stems from improper handling of highly compressed data [CWE-409], allowing a remote attacker to send a small, crafted payload that expands into a disproportionately large in-memory structure. Processing such payloads consumes excessive memory and CPU on the receiving service, causing denial of service. The issue affects all versions of Apache Thrift prior to 0.24.0 and is remotely exploitable without authentication or user interaction.
Critical Impact
An unauthenticated network attacker can crash or exhaust resources on Thrift-based Ruby services by submitting compressed payloads that expand into oversized decoded messages.
Affected Products
- Apache Thrift (Ruby bindings) — all versions prior to 0.24.0
- Services and applications embedding vulnerable Thrift Ruby client or server libraries
- Downstream distributions and gems that repackage the affected Thrift Ruby code
Discovery Timeline
- 2026-07-27 - CVE-2026-49158 published to the National Vulnerability Database (NVD)
- 2026-07-27 - Entry last modified in NVD
Technical Details for CVE-2026-49158
Vulnerability Analysis
The Apache Thrift Ruby bindings decode incoming messages without enforcing sufficient bounds on the ratio between compressed input size and decoded output size. An attacker can craft a compact, highly compressible payload whose decoded representation is orders of magnitude larger than the transmitted bytes. When the Ruby runtime allocates buffers for the expanded structure, memory pressure and garbage collector overhead spike, degrading or halting the service.
The issue is classified under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification). Impact is limited to availability; confidentiality and integrity are not affected. The Apache Thrift project addressed the issue in version 0.24.0, published alongside the Apache mailing list announcement.
Root Cause
The Ruby serialization and transport layers accept compressed or nested Thrift structures and expand them into native objects without validating cumulative decoded size, element counts, or nesting depth against configured limits. This missing enforcement lets a single request drive unbounded memory allocation.
Attack Vector
A remote attacker sends a specially crafted Thrift message over any network transport the service exposes. No credentials or user interaction are required. The malformed payload triggers excessive allocation during deserialization, exhausting memory and CPU. Repeated requests amplify the effect and can take a service cluster offline. Technical background is available in the Openwall OSS Security post and the Apache mailing list thread.
No public proof-of-concept exploit is currently available for CVE-2026-49158.
Detection Methods for CVE-2026-49158
Indicators of Compromise
- Sudden spikes in resident memory usage on Ruby processes hosting Thrift endpoints, followed by out-of-memory kills or worker restarts.
- Elevated CPU utilization correlated with small inbound requests to Thrift service ports.
- Application logs showing deserialization errors, timeouts, or NoMemoryError exceptions from Thrift call stacks.
- Repeated short-lived connections from a narrow set of source IPs delivering unusually small payloads that produce heavy backend load.
Detection Strategies
- Inventory all Ruby applications importing the thrift gem and identify versions below 0.24.0.
- Instrument Thrift handlers to log decoded message size and reject payloads whose expansion ratio exceeds a defined threshold.
- Alert on process-level memory growth rates that exceed historical baselines for Thrift service workers.
- Correlate network telemetry with application performance metrics to detect small-request, high-impact patterns characteristic of amplification abuse.
Monitoring Recommendations
- Track memory, CPU, and GC pause metrics per Thrift worker and page on sustained anomalies.
- Capture and retain request-size and response-latency histograms for Thrift endpoints to support post-incident analysis.
- Forward Ruby application logs and system OOM events to a centralized analytics pipeline for correlation with network flow data.
How to Mitigate CVE-2026-49158
Immediate Actions Required
- Upgrade the Apache Thrift Ruby bindings to version 0.24.0 or later across all services and dependencies.
- Audit build manifests, Gemfile.lock files, and container images to confirm no vulnerable version remains in production.
- Restrict network exposure of Thrift endpoints to trusted clients while patching is in progress.
- Add rate limiting and per-connection resource caps in front of Thrift services to blunt amplification attempts.
Patch Information
The Apache Thrift project fixed CVE-2026-49158 in version 0.24.0. Upgrade instructions and release details are available in the Apache Thrift advisory thread. Rebuild and redeploy any Ruby applications, gems, or container images that bundle the Thrift library after the upgrade.
Workarounds
- Place Thrift services behind a reverse proxy or API gateway that enforces strict request size limits.
- Configure operating system and container memory limits so that a single worker cannot exhaust host resources.
- Terminate Thrift connections that exceed defined deserialization time or memory budgets.
- Restrict Thrift endpoints to internal networks or mutually authenticated clients until the patched version is deployed.
# Upgrade the Apache Thrift Ruby gem to the fixed release
gem update thrift --version '>= 0.24.0'
# Verify the installed version
ruby -e 'require "thrift"; puts Thrift::VERSION'
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

