CVE-2026-114495
JSON

7.8high

codebase-memory-mcp: Heap buffer overflow on artifact import via int-truncated decompression capacity

Severity
7.8high CVSS:3.1 by GitHub_M
Exploit likelihood
0.24% (higher than 15% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-8xwq-xv2x-853r

Description

codebase-memory-mcp provides local code intelligence for developers and AI agents through a persistent graph and MCP tools. Prior to 0.9.0, automatic import of a repository's .codebase-memory/ artifact allocated a decompression buffer using the attacker-controlled 64-bit original_size value from artifact.json but truncated that value to int when passing the destination capacity to the Zstandard decompressor. A value with bit 31 set became negative and was sign-extended to a large size_t, allowing the decompressor to write frame content beyond the actual allocation. Indexing a malicious repository containing the crafted artifact could corrupt heap memory with attacker-controlled bytes, causing a reliable crash and potentially code execution. This issue is fixed in version 0.9.0.

Affected

Product or packageVersionsReported by
DeusData codebase-memory-mcp< 0.9.0CVE List
codebase-memory-mcp (npm)before 0.9.0GitHub Advisory Database
codebase-memory-mcp (PyPI)before 0.9.0GitHub Advisory Database

All scores

GitHub_M7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
GitHub7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Classification

CWE-190CWE-681CWE-787

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

codebase-memory-mcp provides local code intelligence for developers and AI agents through a persistent graph and MCP tools. Prior to 0.9.0, automatic import of a repository's .codebase-memory/ artifact allocated a decompression buffer using the attacker-controlled 64-bit original_size value from artifact.json but truncated that value to int when passing the destination capacity to the Zstandard decompressor. A value with bit 31 set became negative and was sign-extended to a large size_t, allowing the decompressor to write frame content beyond the actual allocation. Indexing a malicious repository containing the crafted artifact could corrupt heap memory with attacker-controlled bytes, causing a reliable crash and potentially code execution. This issue is fixed in version 0.9.0.

GitHub Advisory Database
Summary

When a repository contains a .codebase-memory/ artifact, indexing it imports the artifact automatically. Before 0.9.0 the decompression buffer was allocated with the 64-bit original_size from the attacker-controlled artifact.json, but the capacity handed to the Zstandard decompressor was truncated to int. A size with bit 31 set became negative, was sign-extended back to a huge size_t, and the decompressor wrote the frame's full content past the real allocation.

Impact

Indexing a malicious repository could corrupt heap memory with attacker-controlled bytes: a reliable crash and potentially code execution. No extra interaction beyond indexing the repository is needed.

Patches

Fixed in stable 0.9.0. The import path takes the decompressed size from the Zstandard frame header, validates it against the metadata and a size cap, and uses the same size_t capacity for allocation and decompression. The decoded length is checked. codebase-memory-mcp has verified this correction in published v0.12.1, together with the size-mismatch regression. That regression is not a direct multi-gigabyte reproduction; this advisory does not claim that all decompression resource-exhaustion cases are eliminated.

Workarounds

Upgrade to a fixed release; the codebase-memory-mcp verified recommendation is v0.12.1. On affected versions, avoid indexing untrusted repositories that contain a .codebase-memory/ artifact.

Credit

Reported privately by Aaron (@aaronjmars). codebase-memory-mcp thanks them for the precise report and re-verification.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-114495 changed 2026-11-25CVE Terms of Use
GitHub Advisory DatabaseGHSA-8xwq-xv2x-853r changed 2026-12-01CC-BY-4.0
NVDCVE-2026-114495 changed 2026-11-25Public domain