{"vuln_id":"CVE-2026-63496","aliases":["GHSA-xvcc-vqjv-phqh"],"description":"augment-virShell allows Command Injection in `grep()` via Unsanitized `searchPattern`","published_at":"2026-11-18T16:15:52Z","modified_at":"2026-11-18T16:15:53Z","first_seen_at":"2026-11-21T19:15:20.145656Z","severity":"high","severity_source":"ghsa","cvss_score":7.8,"cvss_vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","cwe":["CWE-78"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00368,"epss_percentile":0.31287,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-63496"},"matched_alias":null,"items":[{"id":2440,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-xvcc-vqjv-phqh / CVE-2026-63496: augment-virShell allows Command Injection in `grep()` via Unsanitized `searchPattern`","summary":"augment-virShell allows Command Injection in `grep()` via Unsanitized `searchPattern`\n\n## Shell Command Injection in `grep()` via Unsanitized `searchPattern`\n\n### Summary\n\nThe `grep()` function exported by `@augment-vir/node` inserts caller-controlled search patterns directly into a double-quoted shell command string without sanitization (`grep.ts:310`). When the constructed command is passed to `spawn()` with `shell: 'bash'` (`shell.ts:98-99`), bash evaluates `$()` command substitution expressions embedded in the pattern, resulting in arbitrary OS command execution as the Node.js process user. Any downstream application that passes untrusted input to `grep()`'s `pattern` or `patterns` field is vulnerable to unauthenticated local (and potentially remote) code execution. CVSS Base Score: **7.8 (High)**.\n\n### Details\n\n**Root cause:** `packages/node/src/augments/fs/grep.ts:310` maps each search pattern into the shell fragment `-e \"${searchPattern}\"` with no sanitization:\n\n```ts\n// grep.ts:310\n...searchPatterns.map((searchPattern) => `-e \"${searchPattern}\"`),\n```\n\nThe resulting full command string is forwarded to `runShellCommand` (`grep.ts:320`), which calls `streamShellCommand` (`shell.ts:221-224`), which ultimately calls:\n\n```ts\n// shell.ts:98-99\nconst childProcess = spawn(command, {\n    shell,   // defaults to 'bash' (shell.ts:92)\n```\n\nBecause `shell` is `'bash'`, bash interprets `$()` within the double-quoted pattern as a command substitution and executes it before `grep` ever runs.\n\n**Incomplete sanitization:** An `escape()` helper exists at `grep.ts:178-180` but only replaces `\"` with `\\\"` and removes newlines. It is applied to `excludePatterns`, `excludeDirs`, and `includeFiles` (`grep.ts:297-308`) but **not** to `searchPatterns`. Even if it were applied, double-quote escaping does not prevent `$()` or backtick substitution inside bash double-quote contexts.\n\n**Data flow (source → sink):**\n\n| Step | Location | Description |\n|------|----------|-------------|\n| 1 | `packages/node/src/index.ts:3` | `export * from './augments/fs/grep.js'` — exposes `grep()` as a public npm API |\n| 2 | `packages/node/src/augments/fs/grep.ts:223-226` | `grep()` accepts caller-controlled `grepSearchPattern` and `grepSearchLocation` |\n| 3 | `packages/node/src/augments/fs/grep.ts:228` | `searchPatterns` derived from `grepSearchPattern.patterns \\|\\| [grepSearchPattern.pattern]` |\n| 4 | `packages/node/src/augments/fs/grep.ts:269-314` | `fullCommand` built as a plain shell string |\n| 5 | `packages/node/src/augments/fs/grep.ts:310` | **Sink:** `searchPattern` inserted as `` `-e \"${searchPattern}\"` `` — no escaping applied |\n| 6 | `packages/node/src/augments/fs/grep.ts:320` | `fullCommand` passed to `runShellCommand` |\n| 7 | `packages/node/src/augments/terminal/shell.ts:221-224` | Forwarded to `streamShellCommand` |\n| 8 | `packages/node/src/augments/terminal/shell.ts:98-99` | `spawn(command, { shell: 'bash' })` executes the constructed command string |\n\n**Suggested remediation:**\n\n```diff\n--- a/packages/node/src/augments/fs/grep.ts\n+++ b/packages/node/src/au\n\nAffected packages: npm:@augment-vir/node\nPatched: @augment-vir/node 31.73.5","url":"https://github.com/advisories/GHSA-xvcc-vqjv-phqh","published_at":"2026-11-18T16:15:52Z","updated_at":"2026-11-18T16:15:53Z","fetched_at":"2026-11-21T19:15:18.416837Z","severity":"high","cvss_score":7.8,"epss":0.00368,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"@augment-vir/node","vuln_id":"CVE-2026-63496","vuln_ids":["CVE-2026-63496","GHSA-XVCC-VQJV-PHQH"],"tags":["ghsa","npm","CWE-78"],"cluster_id":2311,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2440","html":"https://vulnwatch.ve1ve2.com/item/2440"}}]}