codebase-memory-mcp: Heap buffer overflow on artifact import via int-truncated decompression capacityGHSA-8xwq-xv2x-853r
HIGHFix: DeusData/codebase-memory-mcp#941GHSA-8xwq-xv2x-853r is a high-severity (CVSS 7.8) CWE-190 vulnerability in codebase-memory-mcp. A fix is available for codebase-memory-mcp — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-8xwq-xv2x-853r.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
codebase-memory-mcp🐍codebase-memory-mcpReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects npm, PyPI packages — download data is not available via public APIs for these ecosystems.
Description
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | codebase-memory-mcp | all versions | 0.9.0npm install codebase-memory-mcp@0.9.0 |
| 🐍PyPI | codebase-memory-mcp | all versions | 0.9.0pip install --upgrade 'codebase-memory-mcp==0.9.0' |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for codebase-memory-mcp, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update codebase-memory-mcp to 0.9.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-8xwq-xv2x-853r is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Frequently Asked Questions
Is GHSA-8xwq-xv2x-853r in your dependencies?
Find it across npm, PyPI, including transitive dependencies.