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.
Published: 2026-10-10
Score: 9.8 Critical
EPSS: < 1% Very Low
KEV: No
Impact: Memory Corruption via Deserialization
Action: Immediate Patch
AI Analysis

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.

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

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 yet.

History

Fri, 16 Oct 2026 16:30:00 +0000

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'}


Sun, 11 Oct 2026 12:45:00 +0000

Type Values Removed Values Added
First Time appeared Apache
Apache datasketches
Vendors & Products Apache
Apache datasketches

Sat, 10 Oct 2026 13:30:00 +0000

Type Values Removed Values Added
References

Sat, 10 Oct 2026 10:45:00 +0000

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

Subscriptions

Apache Datasketches
cve-icon MITRE

Status: PUBLISHED

Assigner: apache

Published:

Updated: 2026-10-16T15:24:57.426Z

Reserved: 2026-09-30T17:45:33.625Z

Link: CVE-2026-103513

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Undergoing Analysis

Published: 2026-10-10T11:17:35.853

Modified: 2026-10-16T16:16:53.457

Link: CVE-2026-103513

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-17T09:00:08Z

Weaknesses