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

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

CVE-2026-103513 is a buffer overflow flaw in Apache DataSketches C++ CPC sketch deserialization that enables out-of-bounds memory access. This post 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-103513 Overview

CVE-2026-103513 is an out-of-bounds read and write vulnerability in the Compressed Probabilistic Counting (CPC) sketch deserialization logic of Apache DataSketches C++ (datasketches-cpp). A crafted serialized CPC sketch passed to cpc_sketch::deserialize(), from either a byte buffer or a stream, can cause the decompressor to read past the end of the compressed input. In the hybrid flavor, it can also write outside an internal heap buffer. The flaw affects versions from 2.0.0-incubating before 5.3.0. Only applications that deserialize CPC sketches from untrusted sources are affected.

Critical Impact

Attackers can corrupt heap memory in applications parsing untrusted CPC sketches, causing crashes and potentially enabling arbitrary code execution over the network without authentication.

Affected Products

  • Apache DataSketches C++ (datasketches-cpp) 2.0.0-incubating through 5.2.x
  • Applications linking datasketches-cpp that deserialize CPC sketches from untrusted sources
  • Downstream language bindings that wrap the vulnerable C++ deserialization code

Discovery Timeline

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

Technical Details for CVE-2026-103513

Vulnerability Analysis

The vulnerability resides in cpc_sketch::deserialize() within the Apache DataSketches C++ library. The CPC sketch format uses a compressed representation that is decoded during deserialization. The decompressor advances a read position through the input buffer, but validation of that position occurs only after decoding completes. An attacker-crafted input can therefore cause reads beyond the end of the compressed data. The issue is classified as an out-of-bounds read [CWE-125], though it also produces out-of-bounds writes in the hybrid flavor path.

Root Cause

The root cause is missing bounds validation during CPC decoding. The read-position check runs after decoding finishes rather than before each byte consumption. For hybrid-flavor sketches, decoded row indices are not validated against the size of an internal heap buffer, allowing out-of-bounds writes. Several header fields, including lg_k, and other decoded values are also accepted without range checks. Any of these unvalidated values can place the decoder in an inconsistent state and corrupt adjacent heap memory.

Attack Vector

Exploitation requires an application that calls cpc_sketch::deserialize() on data received from an untrusted source. This includes analytics services that accept serialized sketches over the network, data pipelines ingesting user-supplied sketch files, and shared-tenant systems that merge sketches from external contributors. No authentication or user interaction is required when the deserialization endpoint is network-reachable. A successful attack corrupts heap memory, which can crash the host process or be shaped into arbitrary code execution. See the Apache mailing list advisory for additional detail.

Detection Methods for CVE-2026-103513

Indicators of Compromise

  • Unexpected crashes, segmentation faults, or abort() calls in processes that invoke cpc_sketch::deserialize()
  • Heap corruption diagnostics from AddressSanitizer or glibc detectors such as malloc_consolidate(): invalid chunk size in sketch-processing services
  • Anomalous or oversized CPC sketch payloads received by analytics endpoints, especially with unusual lg_k header values

Detection Strategies

  • Deploy fuzzing with libFuzzer or AFL++ against cpc_sketch::deserialize() to surface malformed inputs reaching production
  • Enable AddressSanitizer in staging builds to catch out-of-bounds reads and writes before deployment
  • Perform software composition analysis to inventory services linking datasketches-cpp versions below 5.3.0

Monitoring Recommendations

  • Alert on repeated process crashes in services that parse user-submitted sketches
  • Log and inspect inbound sketch payload sizes and header fields for outliers
  • Correlate crash telemetry with upstream network sources to identify abuse attempts

How to Mitigate CVE-2026-103513

Immediate Actions Required

  • Upgrade datasketches-cpp to version 5.3.0 or later in all applications and rebuild dependent binaries
  • Audit all code paths that call cpc_sketch::deserialize() and identify any that accept untrusted input
  • Temporarily disable or gate deserialization endpoints that process externally supplied CPC sketches until patched builds are deployed

Patch Information

The fix is available in Apache DataSketches C++ version 5.3.0. See the GitHub Release 5.3.0 and the OpenWall OSS-Security update for release notes and the official announcement. The patch adds validation of the decoder read position during decoding and validates header fields and decoded row indices before use.

Workarounds

  • Restrict CPC sketch deserialization to trusted internal sources only, enforced at the network and application layers
  • Validate payload size and header fields such as lg_k against expected ranges before passing data to the deserializer
  • Run deserialization in an isolated process or sandbox with strict resource limits to contain memory corruption
bash
# Example: pin and verify datasketches-cpp 5.3.0 in a CMake-based build
cmake -DDATASKETCHES_VERSION=5.3.0 -B build
cmake --build build --target datasketches
ldd ./your_service | grep datasketches

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.