---
id: "CVE-2026-103634"
kind: "vulnerability"
aliases: ["CVE-2026-103634"]
title: "Apache DataSketches C++: crafted Count-Min sketch corrupts heap memory"
severity: "unknown"
cvss: null
epss: 0.00198
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["c++", "data-pipelines", "datasketches", "package"]
not_affected_if: ["no-count-min-deserialization", "trusted-input-only", "version-5.3.0-or-later"]
published_at: "2026-10-22T07:16:40+00:00"
first_seen_at: "2026-10-23T21:57:30+00:00"
updated_at: "2026-10-25T05:00:32+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-103634", "first_seen_at": "2026-10-23T21:57:30+00:00"}, {"source": "epss", "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-103634", "first_seen_at": "2026-10-24T07:15:52+00:00"}]
---

# Apache DataSketches C++: crafted Count-Min sketch corrupts heap memory

Apache DataSketches C++ mishandles Count-Min sketch deserialization: a truncated or crafted sketch can read past the input buffer and, through a 32-bit size overflow, leave an empty table that later updates and queries read and write outside. An attacker who supplies a crafted sketch can crash the process and may be able to corrupt heap memory further.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the datasketches-cpp version in use; affected range is from `4.1.0` before `5.3.0`
- Search the codebase for calls to `count_min_sketch::deserialize()` and confirm whether the input can come from untrusted sources

## Fix

- Upgrade Apache DataSketches C++ to `5.3.0` or later

## Timeline

- 2026-10-23T21:57:30+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-103634
- 2026-10-24T07:15:52+00:00 epss https://api.first.org/data/v1/epss?cve=CVE-2026-103634

## From the sources

Out-of-bounds read and write in the Count-Min sketch deserialization of Apache DataSketches C++ (repo: datasketches-cpp).

count_min_sketch::deserialize() did not include the preamble in its input size check, so a truncated sketch could cause a read of up to 16 bytes past the end of the input. In addition, the table size was computed from the serialized number of buckets and number of hash functions in 32-bit arithmetic. A crafted sketch could make it wrap to zero, so that the sketch deserialized with an empty table, and later updates and estimate queries read and wrote outside the heap allocation. This can corrupt heap memory, causing a crash and potentially enabling further exploitation.

This issue affects Apache DataSketches C++: from 4.1.0 before 5.3.0. Only applications that deserialize Count-Min sketches from untrusted sources are affected.

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

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
