{
  "id": "CVE-2026-9277",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-9277",
  "published_at": "2026-05-22T13:22:38.873Z",
  "title": "shell-quote `quote()` does not validate object-token shapes, allowing command injection via line terminators in `.op`",
  "product": "shell-quote",
  "cvss": {
    "score": 9.2,
    "source": "cna",
    "vector": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": {
    "created_at": "2026-06-15T13:37:09Z",
    "first_seen_at": "2026-11-14T11:25:11.578Z",
    "days_after_publication": 24,
    "repo": "DylanZahedi/CVE-2026-9277",
    "source": "github"
  },
  "poc_repo_count": 1,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "shell-quote's `quote()` function did not validate object-token inputs against the operator model used by `parse()`. The `.op` field was backslash-escaped character by character using `/(.)/g`, which in JavaScript does not match line terminators (\\n, \\r, U+2028, U+2029). A line terminator in `.op` therefore passed through unescaped into the output; POSIX shells treat a literal newline as a command separator, so any content after it would execute as a second command. The vulnerable code path is reachable in two ways: (1) direct construction of `{ op: '...\\n...' }` from external input, and (2) via `parse(cmd, envFn)` when `envFn` returns object tokens whose `.op` is attacker-influenced. Both are documented API surface. Fixed by replacing the per-character escape with strict shape validation: `.op` must match the parser's control-operator allowlist; `{ op: 'glob', pattern }` validates `pattern` and forbids line terminators; `{ comment }` validates `comment` and forbids line terminators; any other object shape throws `TypeError`.",
  "cwe": "CWE-78",
  "cvss_by_source": {
    "cna": 9.2
  },
  "repos": [
    {
      "repo": "DylanZahedi/CVE-2026-9277",
      "url": "https://github.com/DylanZahedi/CVE-2026-9277",
      "created_at": "2026-06-15T13:37:09Z",
      "first_seen_at": "2026-11-14T11:25:11.578Z",
      "stars": 2,
      "is_poc": "yes",
      "kind": "exploit",
      "suspicion_score": 30,
      "suspicious": false,
      "suspicion_reasons": [
        "references an exfiltration/paste endpoint in README.md"
      ],
      "status": "analyzed",
      "owner_created_at": "2023-05-01T06:49:03Z"
    }
  ],
  "remediation": {
    "affected": [
      {
        "vendor": "",
        "product": "shell-quote",
        "ranges": [
          "\u003e= 1.1.0, \u003c 1.8.4"
        ],
        "fixed_in": [
          "1.8.4"
        ]
      }
    ],
    "upgrade": [
      "Upgrade shell-quote to 1.8.4 or later."
    ],
    "references": [
      {
        "kind": "Vendor advisory",
        "url": "https://github.com/ljharb/shell-quote/security/advisories/GHSA-w7jw-789q-3m8p"
      },
      {
        "kind": "Patch",
        "url": "https://github.com/ljharb/shell-quote/commit/1518179"
      }
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [
    {
      "method": "POST",
      "path_template": "/",
      "body_markers": [
        "\"op\": \";\\nid\"",
        "\"op\": \";\\nwhoami\"",
        "\"op\": \";\\nsleep",
        "\"op\": \";\\ncurl\"",
        "\"op\": \";\\nwget\"",
        "\"op\": \";\\nnslookup\""
      ],
      "content_type": "application/json",
      "user_agents": [
        "python-requests (default)"
      ],
      "protocol": "https",
      "repos": [
        "DylanZahedi/CVE-2026-9277"
      ],
      "repo_count": 1,
      "confidence": 0.6,
      "evidence": [
        "DylanZahedi/CVE-2026-9277/CVE-2026-9277.py:58",
        "DylanZahedi/CVE-2026-9277/CVE-2026-9277.py:94",
        "DylanZahedi/CVE-2026-9277/CVE-2026-9277.py:135",
        "DylanZahedi/CVE-2026-9277/CVE-2026-9277.py:150",
        "DylanZahedi/CVE-2026-9277/CVE-2026-9277.py:158"
      ]
    }
  ],
  "rules": []
}
