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

CVE-2026-103634: Apache DataSketches C++ Buffer Overflow

CVE-2026-103634 is a buffer overflow in Apache DataSketches C++ allowing out-of-bounds memory access during Count-Min sketch deserialization. This article covers technical details, affected versions, impact, 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-103634 Overview

CVE-2026-103634 is an out-of-bounds read and write vulnerability in the Count-Min sketch deserialization logic of Apache DataSketches C++ (datasketches-cpp). The flaw resides in count_min_sketch::deserialize(), which omits the preamble from its input size check. A truncated sketch can trigger a read of up to 16 bytes past the end of the input buffer. A separate 32-bit integer overflow [CWE-190] in the table size calculation lets a crafted sketch wrap to zero, producing an empty internal table while later updates and estimate queries access memory outside the heap allocation. Only applications that deserialize Count-Min sketches from untrusted sources are affected.

Critical Impact

Attackers who supply crafted Count-Min sketch data can corrupt heap memory, crash the process, and potentially achieve further exploitation in applications linking Apache DataSketches C++ versions 4.1.0 through 5.2.x.

Affected Products

  • Apache DataSketches C++ (datasketches-cpp) version 4.1.0
  • Apache DataSketches C++ versions 4.1.0 up to, but not including, 5.3.0
  • Applications that deserialize Count-Min sketches from untrusted input

Discovery Timeline

  • 2026-10-22 - CVE-2026-103634 published to NVD
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2026-103634

Vulnerability Analysis

The vulnerability affects the Count-Min sketch deserialization path in Apache DataSketches C++. Two distinct defects combine to produce memory-safety failures.

The first defect is an incomplete input size check in count_min_sketch::deserialize(). The size validation does not account for the serialized preamble bytes. When a truncated sketch is supplied, the deserializer can read up to 16 bytes beyond the end of the input buffer, exposing adjacent heap contents to further processing.

The second defect is a 32-bit integer overflow [CWE-190] in the computation of the internal hash table size. The number of buckets and the number of hash functions are read from the serialized sketch and multiplied in 32-bit arithmetic. A crafted combination of values wraps the product to zero, so the sketch is constructed with an empty backing table. Subsequent update() and estimate query operations index into memory the sketch does not own, producing out-of-bounds reads and writes against the heap.

Root Cause

The root cause is unsafe deserialization of attacker-controlled length and dimension fields without bounds-checked, width-appropriate arithmetic. The size check omits the preamble, and the table allocation size is derived from untrusted inputs using 32-bit multiplication that lacks overflow detection.

Attack Vector

Exploitation requires an application that passes externally sourced byte streams to Count-Min sketch deserialization. An attacker crafts a serialized sketch containing either a truncated payload or specific num_buckets and num_hashes values whose 32-bit product is zero. When the application loads the sketch and performs updates or estimate queries, the library reads and writes outside the allocated buffer. The result is heap corruption, process crash, or potential code execution depending on allocator state and surrounding objects.

See the GitHub Release 5.3.0 notes and the Apache mailing list advisory for upstream technical details.

Detection Methods for CVE-2026-103634

Indicators of Compromise

  • Unexpected crashes, SIGSEGV, or heap corruption aborts in processes that call Apache DataSketches C++ deserialization routines
  • Application logs showing failures inside count_min_sketch::deserialize(), update(), or get_estimate() call paths
  • Receipt of serialized Count-Min sketches from untrusted peers, queues, or storage with malformed preambles or extreme num_buckets and num_hashes fields

Detection Strategies

  • Inventory binaries and container images that link datasketches-cpp between versions 4.1.0 and 5.2.x using software composition analysis
  • Instrument staging builds with AddressSanitizer (ASan) and run representative Count-Min deserialization workloads to surface out-of-bounds access
  • Monitor for anomalous input sizes and dimension fields on data paths that accept serialized sketches from external systems

Monitoring Recommendations

  • Alert on repeated deserialization errors or process restarts in services that ingest sketch data from untrusted producers
  • Capture core dumps from affected services and verify crash sites against count_min_sketch symbols
  • Track egress and ingress channels carrying sketch payloads to identify untrusted sources that should be gated behind validation

How to Mitigate CVE-2026-103634

Immediate Actions Required

  • Upgrade Apache DataSketches C++ to version 5.3.0 or later across all build pipelines, container images, and deployed binaries
  • Identify every application that calls count_min_sketch::deserialize() on data originating outside the trust boundary and prioritize those for patching
  • Rebuild and redeploy downstream libraries and services that statically link the vulnerable version

Patch Information

Apache has fixed the issue in Apache DataSketches C++ 5.3.0. The fix corrects the input size check to include the preamble and performs the table size computation with overflow-safe arithmetic. Obtain the release from the GitHub Release 5.3.0 page. Additional context is available on the OpenWall oss-security discussion.

Workarounds

  • Restrict Count-Min sketch deserialization to sketches produced by trusted internal systems only
  • Validate and bound num_buckets and num_hashes fields before invoking deserialization, rejecting any payload whose product does not fit in a safe range
  • Enforce a strict minimum input length that includes the preamble bytes before passing data to the library
bash
# Configuration example: pin the fixed version in build systems
# vcpkg
vcpkg install datasketches[core]  # ensure version >= 5.3.0

# CMake FetchContent
FetchContent_Declare(
  datasketches
  GIT_REPOSITORY https://github.com/apache/datasketches-cpp.git
  GIT_TAG        5.3.0
)

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.