5.5medium
codebase-memory-mcp: git option injection through base_branch in detect_changes allows writing a file outside the project
- Severity
- 5.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.29% (higher than 23% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-2vj2-hwgx-6f23
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, the detect_changes tool validated the base_branch argument for shell metacharacters but omitted the leading-dash check before placing the value in the revision position of a git diff command. Git therefore interpreted an option-shaped base_branch value, including --output, as a command option instead of a revision, allowing a caller to create or overwrite a caller-chosen file with Git diff output under the server process's permissions. Arbitrary code execution was not demonstrated. This issue is fixed in version 0.9.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| DeusData codebase-memory-mcp | < 0.9.0 | CVE List |
| codebase-memory-mcp (npm) | before 0.9.0 | GitHub Advisory Database |
| codebase-memory-mcp (PyPI) | before 0.9.0 | GitHub Advisory Database |
All scores
| GitHub_M | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N |
| GitHub | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
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, the detect_changes tool validated the base_branch argument for shell metacharacters but omitted the leading-dash check before placing the value in the revision position of a git diff command. Git therefore interpreted an option-shaped base_branch value, including --output, as a command option instead of a revision, allowing a caller to create or overwrite a caller-chosen file with Git diff output under the server process's permissions. Arbitrary code execution was not demonstrated. This issue is fixed in version 0.9.0.
GitHub Advisory Database
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.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-114496 changed 2026-11-20 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-2vj2-hwgx-6f23 changed 2026-12-01 | CC-BY-4.0 |
| NVD | CVE-2026-114496 changed 2026-11-20 | Public domain |