GHSA-8xwq-xv2x-853r

Suggest an improvement
Source
https://github.com/advisories/GHSA-8xwq-xv2x-853r
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-8xwq-xv2x-853r/GHSA-8xwq-xv2x-853r.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-8xwq-xv2x-853r
Aliases
Published
2026-12-01T00:39:56Z
Modified
2026-12-01T01:00:04Z
Severity
  • 7.8 (High) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H CVSS Calculator
Summary
codebase-memory-mcp: Heap buffer overflow on artifact import via int-truncated decompression capacity
Details

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.

Database specific
{
    "cwe_ids":  [
        "CWE-190",
        "CWE-681",
        "CWE-787"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-12-01T00:39:56Z",
    "nvd_published_at":  "2026-11-20T20:17:10Z",
    "severity":  "HIGH"
}
References

Affected packages

npm / codebase-memory-mcp

Package

Name
codebase-memory-mcp
View open source insights on deps.dev
Purl
pkg:npm/codebase-memory-mcp

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
0.9.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-8xwq-xv2x-853r/GHSA-8xwq-xv2x-853r.json"

PyPI / codebase-memory-mcp

Package

Name
codebase-memory-mcp
View open source insights on deps.dev
Purl
pkg:pypi/codebase-memory-mcp

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
0.9.0

Affected versions

0.*
0.8.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-8xwq-xv2x-853r/GHSA-8xwq-xv2x-853r.json"