Code Graph RAG command injection via xargs in shell allowlist
Affects code-graph-rag before 0.0.845 when an approved or --yolo shell command uses xargs to launch a non-allowlisted interpreter. Fixed in 0.0.845.
- Exploited
- No known exploitation
- Fix
- Fixed in 0.0.845
- Who is exposed
- Specific setups only
Summary
Code Graph RAG, a tool from vitali87 for querying and editing codebases, lets an attacker who can influence a model-issued shell command run arbitrary code outside the project root as the process user. A local attacker with low privileges can trigger this, but only after a human approves the command in default mode or without any approval in --yolo mode.
Written by a model
Original description
Code Graph RAG is an AI-powered knowledge graph and retrieval system for querying, understanding, and editing multi-language codebases. In 0.0.844 and earlier, execute_shell_command in codebase_rag/tools/shell_command.py validates only the base command, not the program launched by allowlisted xargs. Its dangerous-pattern filter misses Python interpreter code using modules such as subprocess instead of importing os, allowing an unlisted interpreter to execute arbitrary code. An attacker influencing a model-issued command can execute code outside the project root as the process user after human approval in default mode, or without approval in --yolo mode. The noninteractive shell wrapper does not allow xargs. This issue is fixed in 0.0.845.
Who should check
Teams running code-graph-rag (pip) 0.0.844 or earlier that let the model run execute_shell_command, with extra exposure under --yolo mode.
Not fixed by: Adding more module names to the blacklist does not fix it.
“The execute_shell_command tool restricts which programs a model-issued shell command may run”
What to do
Check whether your setup matches what the bug needs.
The vulnerable command must use xargs, which is on the allowlist, to launch a non-allowlisted interpreter. In --yolo mode the approval step is skipped entirely, so the command runs unattended.Upgrade to a fixed version: 0.0.845.
Check your systems with an agent
Paste this into a coding or ops agent. It checks your systems read-only and reports a table per asset.
Check whether my systems are affected by CVE-2026-137185 (Code Graph RAG: EXECUTE_SHELL allowlist and dangerous-pattern blacklist both miss xargs <interpreter> -c — approved/yolo shell commands…), using the cve.now data below.
Rules: work read-only. Do not run exploit code, proof-of-concept scripts or scanners that send attack payloads, and do not change any configuration, package, image or deployment. Report findings only.
What cve.now has for CVE-2026-137185 (entry last updated 2026-11-30):
Affected:
- vitali87 code-graph-rag: fixed in 0.0.845
Fixed versions: 0.0.845.
Conditions (all must be true for the bug to be hit):
- The vulnerable command must use xargs, which is on the allowlist, to launch a non-allowlisted interpreter. (source: https://github.com/vitali87/code-graph-rag/security/advisories/GHSA-wvxg-744g-6pcg)
- In --yolo mode the approval step is skipped entirely, so the command runs unattended. (source: https://github.com/vitali87/code-graph-rag/security/advisories/GHSA-wvxg-744g-6pcg)
Setup: unknown whether the bug needs a non-default feature or setting. Check the advisory.
Attacker needs: local access, low-privilege login, a user action.
CISA KEV: CVE-2026-137185 is not listed as of cve.now's last read.
This KEV status is for CVE-2026-137185 only. If you also check another CVE, look up its own KEV status; never assume it from this one.
How to check:
- Installed software: check what is actually running, not what a repo declares. Read the version from each host, container image and Kubernetes node (the binary's version output, the OS package database, image layers), and check whether the conditions above hold there. Distribution packages may carry a backported fix under an older version number; confirm against the distribution's own advisory.
Verify against the linked advisories before concluding, and cite the date you read each one:
- https://github.com/vitali87/code-graph-rag/security/advisories/GHSA-wvxg-744g-6pcg
- https://github.com/vitali87/code-graph-rag/commit/033b64be855c0d2c0767d8dd225fe0129ebe05da
- https://github.com/vitali87/code-graph-rag/commit/25c4c7ecfc8d030380ab11fbacd412db210193fc
- https://github.com/vitali87/code-graph-rag/releases/tag/v0.0.845
Do not conclude an asset is unaffected unless you checked it and the evidence covers both its version and the conditions above. If you could not check something, mark it unknown and say what is missing.
Report a table with one row per asset and these columns: Asset | Version or build | Status (affected, fixed, not applicable, unknown) | Compensating controls | Exposure (internet-facing, internal, none) | Evidence | Next action.
Entry: https://cve.now/CVE-2026-137185
For follow-up questions, use the cve.now MCP server at https://mcp.cve.now/mcp (no authentication), for example execute with name cve.get and arguments {"id": "CVE-2026-137185"}.Affected versions
- vitali87 code-graph-ragfixed in 0.0.845
cve.now Index
- Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
- Exposure5/25Specific setups only
- Reach?/20Unknown. No tracked technology or package matched
- Severity7.3/10CVSS 7.3
- No patch0/5No signal
What would change the score
- Would score about 62 if added to CISA KEV
- Would score about 57 if CISA's SSVC rates exploitation active
- Would score about 22 if CISA's SSVC rates it automatable
Timeline
- CVE published
- First seen by cve.now
Evidence 6
| Kind | Source |
|---|---|
| Vendor advisory 1Establishes: Affected and fixed versions. | |
| Advisory | GitHub · vitali87/code-graph-rag · Advisory GHSA-wvxg-744g-6pcg |
| CVE record 2Establishes: The identifier and description. | |
| Record | CVE List · CVE-2026-137185 |
| Record | NVD · CVE-2026-137185 |
| Other links 3 | |
| Repository | GitHub · vitali87/code-graph-rag · Commit 033b64be |
| Repository | GitHub · vitali87/code-graph-rag · Commit 25c4c7ec |
| Repository | GitHub · vitali87/code-graph-rag · Release v0.0.845 |
Questions about CVE-2026-137185
Is CVE-2026-137185 being exploited?
It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.
Source: cve.now feed data
What does this mean?
The EXECUTE_SHELL allowlist and dangerous-pattern filter miss xargs used to start an interpreter with -c, so a non-allowlisted interpreter can run through the allowed xargs command. In --yolo mode the approval step is skipped entirely, so such commands run unattended.
Source: github.com
Which versions are affected by CVE-2026-137185?
code-graph-rag: before 0.0.845.
Source: cve.now feed data
Am I affected, and how do I check?
The vulnerable range is code-graph-rag versions before 0.0.845. The issue requires a shell command that uses xargs to launch a non-allowlisted interpreter, and it applies to commands that were approved or run in --yolo mode. Check the installed code-graph-rag version to see whether it falls before 0.0.845.
Source: github.com
How do I fix CVE-2026-137185?
Upgrade code-graph-rag to 0.0.845 or later, which is the listed fixed version.
Source: github.com
Related
- CVE-2026-77604Code Graph RAG: MCP paginated read_file path traversal / arbitrary file read
- CVE-2026-87008Code Graph RAG structural tools follow out-of-root symlinks
- CVE-2026-137180Breeze: Script parameter values could inject commands into agent script execution
- CVE-2026-115422389-ds-base: 389-ds-base: vlv response metadata exposes protected ldap attribute values
- CVE-2026-138436TRENDnet TEW-824DRU ssi os command injection
- CVE-2026-137199cross-spawn: Command injection on Windows when spawning batch files
No corrections so far. Something wrong on this page? Report an error.