CVE-2026-103513

Apache DataSketches: datasketches-cpp: Out-of-bounds read and write in the CPC sketch deserialization allows memory corruption via a crafted sketch

Published Oct 10, 2026 CVSS 3.1 · 9.8 Critical EPSS < 1% KEV · Not listed
Description
Out-of-bounds read and write in the CPC sketch deserialization of Apache DataSketches C++ (repo: 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 data, because the read position was only checked after decoding finished. In the hybrid flavor, it can also cause a write outside an internal heap buffer, because decoded row indices were not validated. Several other header fields and decoded values, including lg_k, were also not validated. This can corrupt heap memory, causing a crash and potentially enabling further exploitation.

This issue affects Apache DataSketches C++: from 2.0.0-incubating before 5.3.0. Only applications that deserialize CPC sketches from untrusted sources are affected.

Users are recommended to upgrade to version 5.3.0, which fixes this issue.

Analysis

AI-generated

Technical impact

Out-of-bounds read and write in the CPC sketch deserialization of Apache DataSketches C++ allow an attacker to corrupt heap memory. The flaw arises because the decompression bounds are only checked after decoding, and decoded row indices and other header fields such as lg_k are not validated. A crafted serialized CPC sketch supplied to cpc_sketch::deserialize() can therefore read past the end of the compressed data and write outside an internal heap buffer, causing a crash or potentially elevating privileges in a running process.

Affected Systems

Apache DataSketches C++ versions 2.0.0‑incubating through 5.2.x are affected. Any application that deserializes CPC sketches from untrusted sources will be vulnerable. Upgrading to version 5.3.0, which removes the flaw, mitigates the issue.

Risk and Exploitability

The vulnerability is triggered by the supply of a crafted sketch; thus the likely attack vector is remote delivery of malicious data or local injection if an application accepts untrusted input. The flaw is an out‑of‑bounds memory corruption (CWE-125 and CWE-787). The CVSS score of 9.8 underscores a critical severity. However, the EPSS score of 0.00186, below 1%, indicates a very low likelihood of exploitation at present. The vulnerability is not listed in the CISA KEV catalog.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Apache DataSketches C++ to version 5.3.0.
  • If an upgrade is not possible immediately, reject or tightly validate sketches before calling cpc_sketch::deserialize(), ensuring that compressed data length and decoded indices stay within expected bounds.
  • Introduce defensive bounds checks around all decompressed values, especially lg_k and row indices, to guard against future similar bugs.
  • Monitor for heap corruption symptoms such as crashes or anomalous memory usage and isolate affected services if an incident occurs.

Generated by OpenCVE AI on October 17, 2026 at 08:57 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
First Time appeared Apache
Apache datasketches
Vendors & Products Apache
Apache datasketches
Type Values Removed Values Added
Description Out-of-bounds read and write in the CPC sketch deserialization of Apache DataSketches C++ (repo: 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 data, because the read position was only checked after decoding finished. In the hybrid flavor, it can also cause a write outside an internal heap buffer, because decoded row indices were not validated. Several other header fields and decoded values, including lg_k, were also not validated. This can corrupt heap memory, causing a crash and potentially enabling further exploitation. This issue affects Apache DataSketches C++: from 2.0.0-incubating before 5.3.0. Only applications that deserialize CPC sketches from untrusted sources are affected. Users are recommended to upgrade to version 5.3.0, which fixes this issue.
Title Apache DataSketches: datasketches-cpp: Out-of-bounds read and write in the CPC sketch deserialization allows memory corruption via a crafted sketch
Weaknesses CWE-125
CWE-787
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
apache
Published
Updated
Oct 16, 2026, 3:24 PM
Reserved
Sep 30, 2026, 5:45 PM
Status
Undergoing Analysis
Published
Oct 10, 2026, 11:17 AM
Modified
Oct 16, 2026, 4:16 PM