GHSA-2vj2-hwgx-6f23

Suggest an improvement
Source
https://github.com/advisories/GHSA-2vj2-hwgx-6f23
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-2vj2-hwgx-6f23/GHSA-2vj2-hwgx-6f23.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-2vj2-hwgx-6f23
Aliases
Published
2026-12-01T00:41:55Z
Modified
2026-12-01T01:00:04Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N CVSS Calculator
Summary
codebase-memory-mcp: git option injection through base_branch in detect_changes allows writing a file outside the project
Details

Summary

Before 0.9.0 the base_branch argument of the detect_changes tool was checked for shell metacharacters but not for a leading dash. The value was placed in the revision position of a git diff invocation, so a value shaped like a git option was honoured by git. An option such as --output=<path> made git write its diff to a caller-chosen file.

Impact

A caller of detect_changes can create or overwrite a file with Git diff output at a caller-chosen path, subject to the server process's permissions. This is the demonstrated integrity impact; arbitrary code execution was not demonstrated.

Patches

Fixed in stable 0.9.0. Option-like values are rejected before Git is invoked. In the verified v0.12.1 release, both since and its base_branch alias pass through the leading-dash check, and the regression verifies rejection.

Workarounds

Upgrade to a fixed release. codebase-memory-mcp recommends v0.12.1, which was verified to contain this fix.

Credit

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

Database specific
{
    "cwe_ids":  [
        "CWE-88"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-12-01T00:41:55Z",
    "nvd_published_at":  "2026-11-20T20:17:11Z",
    "severity":  "MODERATE"
}
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-2vj2-hwgx-6f23/GHSA-2vj2-hwgx-6f23.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-2vj2-hwgx-6f23/GHSA-2vj2-hwgx-6f23.json"