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

CVE-2026-103635: Apache DataSketches C++ DOS Vulnerability

CVE-2026-103635 is an out-of-bounds read flaw in Apache DataSketches C++ that can cause crashes and expose memory contents when deserializing untrusted Theta sketches. This article covers technical details, affected versions, impact analysis, and mitigation strategies.

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-103635 Overview

CVE-2026-103635 is an out-of-bounds read vulnerability in Apache DataSketches C++, affecting the compact Theta sketch deserialization logic. The compact_theta_sketch::deserialize() and wrapped_compact_theta_sketch::wrap() functions read header fields before validating input length. For the compressed format, a 32-bit integer overflow defeats the size check, and two decoding-control header fields are not validated. A crafted or truncated sketch triggers a read past the end of the input buffer. The over-read can be large in the compressed path, and the leaked bytes can become part of the deserialized sketch. This weakness is classified as [CWE-125] Out-of-Bounds Read.

Critical Impact

Attackers can crash applications and potentially exfiltrate adjacent memory contents by submitting malicious Theta sketches to any service that deserializes them from untrusted sources.

Affected Products

  • Apache DataSketches C++ (datasketches-cpp) versions 3.1.0 through 5.2.x
  • Applications linking datasketches-cpp that deserialize Theta sketches from untrusted sources
  • Downstream analytics services ingesting serialized Theta sketches over the network

Discovery Timeline

  • 2026-10-10 - CVE-2026-103635 published to NVD
  • 2026-10-16 - Last updated in NVD database

Technical Details for CVE-2026-103635

Vulnerability Analysis

Apache DataSketches C++ provides streaming algorithms for approximate analytics, including Theta sketches used for cardinality estimation. The compact Theta sketch deserializer parses header metadata from a byte buffer before confirming the buffer contains enough bytes. Attackers who control the serialized input can craft headers that cause the parser to read past the allocated buffer.

The compressed deserialization path contains a more severe variant. The length validation uses 32-bit arithmetic that wraps around when attacker-controlled size fields are large enough to overflow. Two header fields that control the decoding routine are consumed without bounds or sanity checks. The oversized read then copies adjacent process memory into the resulting sketch object, where it may be returned to the caller or further processed.

The same defect affects stream-based deserialization. Any service that reads Theta sketches from untrusted sources, including distributed query engines, aggregation pipelines, or RPC endpoints, inherits the exposure.

Root Cause

The root cause is missing length validation combined with an integer overflow in the compressed-format size check. Header fields are dereferenced before the deserializer confirms the input length satisfies the declared payload size. Decoding-control fields are trusted as-is rather than validated against safe ranges.

Attack Vector

An attacker submits a crafted or truncated Theta sketch to any endpoint that calls compact_theta_sketch::deserialize() or wrapped_compact_theta_sketch::wrap(). No authentication or user interaction is required when the deserializer is reachable over the network. The attacker gains a denial-of-service primitive and a memory disclosure channel without needing code execution.

See the Apache mailing list advisory for additional technical details.

Detection Methods for CVE-2026-103635

Indicators of Compromise

  • Unexpected crashes or signal 11 (SIGSEGV) in processes linking datasketches-cpp versions 3.1.0 through 5.2.x
  • Deserialization errors or truncated-input exceptions originating from Theta sketch parsing code paths
  • Inbound payloads with Theta sketch headers declaring compressed sizes near or above UINT32_MAX

Detection Strategies

  • Inventory binaries and containers for linked versions of datasketches-cpp using software composition analysis
  • Instrument the deserialization entry points with AddressSanitizer or Valgrind in test environments to confirm out-of-bounds reads
  • Monitor application logs for repeated deserialization failures from the same source IP or client identifier

Monitoring Recommendations

  • Capture process crash telemetry and correlate restarts of analytics or query services with inbound sketch payloads
  • Alert on anomalous payload sizes submitted to endpoints that accept serialized sketches
  • Track egress volume from services that return deserialized sketch objects to detect memory disclosure patterns

How to Mitigate CVE-2026-103635

Immediate Actions Required

  • Upgrade datasketches-cpp to version 5.3.0 and rebuild all dependent binaries and container images
  • Audit application code for calls to compact_theta_sketch::deserialize() and wrapped_compact_theta_sketch::wrap() that process untrusted input
  • Restrict network access to services that deserialize Theta sketches until patching completes

Patch Information

The Apache DataSketches project fixed this issue in datasketches-cpp 5.3.0. The release adds length validation before header fields are read, replaces the overflow-prone size check with safe arithmetic, and validates the two decoding-control header fields. See the Openwall OSS-Security announcement for the upstream disclosure.

Workarounds

  • Reject or quarantine serialized sketches received from untrusted sources until the patched library is deployed
  • Terminate TLS and apply strict size limits at an upstream proxy to block oversized sketch payloads
  • Isolate deserialization workers in separate processes with minimal privileges to reduce memory disclosure impact
bash
# Upgrade datasketches-cpp to the fixed release
git clone --branch 5.3.0 --depth 1 https://github.com/apache/datasketches-cpp.git
cd datasketches-cpp
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
sudo cmake --install build

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.