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

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

CVE-2026-103636 is a denial of service vulnerability in Apache DataSketches C++ caused by an out-of-bounds read during VarOpt union deserialization. This article covers the technical details, affected versions, and mitigation steps.

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

CVE-2026-103636 is an out-of-bounds read vulnerability [CWE-125] in the var_opt_union::deserialize() function of Apache DataSketches C++. The flaw affects versions from 2.0.0-incubating before 5.3.0. The function reads a 32-byte preamble of a non-empty union after validating that only 8 bytes are available. A truncated serialized union can trigger a read of up to 24 bytes past the input buffer. Only applications that deserialize VarOpt unions from untrusted sources are exposed.

Critical Impact

Attackers can send a crafted serialized VarOpt union to crash the process (denial of service) and potentially expose adjacent memory contents through the deserialized union state.

Affected Products

  • Apache DataSketches C++ 2.0.0-incubating through 5.2.x
  • Applications linking datasketches-cpp that deserialize VarOpt unions from untrusted input
  • Downstream services exposing deserialization endpoints that accept serialized sketch data

Discovery Timeline

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

Technical Details for CVE-2026-103636

Vulnerability Analysis

The vulnerability resides in var_opt_union::deserialize() within the Apache DataSketches C++ library. The function validates that the input buffer contains at least 8 bytes before proceeding. For non-empty unions, the code then reads a full 32-byte preamble without re-checking buffer bounds. This produces a read of up to 24 bytes beyond the end of the input buffer.

A secondary defect compounds the issue. The remaining size for the embedded sketch is computed using an unsigned subtraction that can wrap around when the input is truncated. The wrap produces an attacker-influenced large value that disables subsequent length checks inside the embedded sketch deserialization. Reads then extend further into adjacent memory.

Bytes read out of bounds are incorporated into the deserialized union's state. This allows the leaked memory contents to influence program behavior or be reflected in downstream outputs, depending on how the application uses the deserialized object.

Root Cause

The root cause is insufficient length validation before accessing the preamble, combined with unchecked unsigned arithmetic when computing the embedded sketch's remaining length. The size precondition only covers the minimum 8-byte header path, not the 32-byte preamble path used for non-empty unions.

Attack Vector

Exploitation requires an application that passes attacker-controlled serialized data to var_opt_union::deserialize(). The attack vector is network-reachable in any service that accepts serialized sketches over an API, message queue, or file upload. No authentication or user interaction is required when the deserialization endpoint is exposed.

The vulnerability mechanism is described in the Apache advisory. See the Apache Mailing List Thread and the Openwall OSS Security Update for technical details.

Detection Methods for CVE-2026-103636

Indicators of Compromise

  • Unexpected crashes or SIGSEGV signals in processes that call var_opt_union::deserialize()
  • AddressSanitizer or Valgrind reports flagging heap-buffer-overflow reads inside datasketches-cpp symbols
  • Malformed or truncated serialized sketch payloads arriving at deserialization endpoints
  • Anomalous memory contents appearing in logs or responses derived from deserialized union state

Detection Strategies

  • Inventory binaries and containers linking datasketches-cpp versions below 5.3.0 using software composition analysis
  • Instrument fuzz testing of deserialization paths with sanitizers to surface truncated-input crashes
  • Monitor service logs for repeated deserialization failures correlated with a single source

Monitoring Recommendations

  • Alert on repeated process restarts of services that ingest serialized sketch data
  • Capture and inspect packet or payload sizes delivered to deserialization endpoints for anomalies
  • Forward crash telemetry and core dump metadata to a centralized data lake for correlation across hosts

How to Mitigate CVE-2026-103636

Immediate Actions Required

  • Upgrade Apache DataSketches C++ to version 5.3.0 or later across all affected builds
  • Audit application code for calls to var_opt_union::deserialize() that accept untrusted input
  • Rebuild and redeploy any statically linked binaries that embed older datasketches-cpp versions
  • Enable AddressSanitizer in test environments to validate the fix and surface related defects

Patch Information

The Apache DataSketches project fixed the issue in version 5.3.0. The release adds correct length validation for the 32-byte preamble and prevents the unsigned subtraction wraparound. See the GitHub Release 5.3.0 for release artifacts and the full commit history.

Workarounds

  • Reject or quarantine serialized VarOpt union payloads smaller than the expected 32-byte preamble before invoking deserialization
  • Restrict deserialization endpoints to authenticated and trusted callers until the upgrade is complete
  • Run affected services under a sandbox or process isolation that limits memory exposure on crash
bash
# Configuration example: pin datasketches-cpp to the fixed version via vcpkg or CMake FetchContent
FetchContent_Declare(
  datasketches
  GIT_REPOSITORY https://github.com/apache/datasketches-cpp.git
  GIT_TAG        5.3.0
)
FetchContent_MakeAvailable(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.