/

CVE-2026-54555

Severity:

HIGH RISK

(7.8)

Privilege Validation Flaw (CWE-863) in rtk Shell Filter

CVE-2026-54555

Deferred

Vulnerability type

Category:

Privilege Management / Authorization

CWE:

CWE-863

Impact:

Bypass of Command Authorization Controls

Severity:

HIGH RISK

(7.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A permission-checking flaw in rtk's shell command splitter allows certain Bash constructs to bypass intended execution boundaries.

Under specific conditions, an attacker can smuggle a hidden command behind an allowed prefix such as git, causing it to run without explicit user confirmation or denial. This becomes risky wherever rtk is relied on to enforce interactive approval for shell execution.

Affected context

This vulnerability occurs in environments that use rtk to filter, rewrite, and enforce permission rules over shell commands before they reach an LLM-assisted workflow.

It specifically affects setups where:

  • rtk's permission splitter is expected to treat certain prefixes (e.g., git) as conditionally allowed commands
  • Bash syntax is used to chain or nest commands in a single line
  • Downstream automation (such as Claude hooks) trusts rtk's exit codes and rewrites as a reliable signal of "allowed" versus "denied"

In these contexts, a single logical command can contain multiple execution segments, and the splitter's non-conservative parsing can leave secondary commands intact.

Exploit preconditions

  • Attack surface: Shell command lines processed by rtk's permission splitter and rewrite logic.
  • Required access: Ability to submit or influence commands that pass through rtk (e.g., via terminal input, automation scripts, or LLM tooling integrations).
  • Trigger point: Use of Bash constructs (such as separators or nested execution syntax) after an allowed prefix to embed additional commands within one line.
  • Why exploitation is possible: The permission splitter fails to treat every Bash execution boundary as a separate command for authorization, and rtk returns exit code 0 for rewritten commands that still contain hidden segments. Downstream hooks interpret this as an "allow" decision and run the full rewritten command without further user approval.

Why this happens

The underlying issue is a logic error in how rtk parses and segments shell command lines for authorization, corresponding to CWE-863 (Incorrect Authorization).

Instead of conservatively treating all Bash execution boundaries and nesting constructs as potential separate commands requiring independent permission checks, the splitter allows complex command lines to be treated as a single authorized unit based on a leading prefix (e.g., git).

This design assumes that the leading allowed command characterizes the entire line's behavior, which is unsafe in the presence of shell syntax that can chain or nest secondary commands. As a result, authorization checks are applied incompletely, and hidden execution segments bypass the intended confirmation flow.

Potential impact

  • Hidden execution of secondary shell commands without explicit user confirmation.
  • Bypass of interactive permission workflows intended to guard against dangerous operations.
  • Unauthorized modification of files, repositories, or environment state via smuggled commands.
  • Escalation of impact when secondary commands perform data exfiltration, destructive actions, or privilege-sensitive operations.

General mitigation guidance

Mitigation typically involves tightening command authorization logic and removing trust in superficial prefixes or incomplete parsing.

Pattern-based defensive approaches include:

  • Treating shell commands as untrusted input and using conservative parsers that recognize all command separators, nesting constructs, and subshell syntax as independent authorization boundaries.
  • Applying "deny-by-default" rules to composite commands, only allowing narrowly defined forms, and rejecting or requiring re-confirmation for lines that contain multiple execution constructs.
  • Decoupling authorization from tool-specific wrappers: permission checks should evaluate the full command semantics, not just leading tokens or superficial rewrites.
  • Minimizing automated "allow" decisions based solely on exit codes; instead, use structured metadata from the splitter that explicitly describes every authorized segment.
  • Designing permission rules around least privilege, where complex or ambiguous command lines require explicit human review.

How teams detect issues like this

Detection can focus on both code-level and runtime behaviors:

  • Static analysis and code review: Look for authorization modules that inspect only the first token or a partial parse of shell commands, especially where Bash syntax (e.g., ;, &&, ||, |, $(), backticks) may introduce additional execution segments. Flag any logic that infers "safe" commands from prefixes without understanding full command structure.
  • Policy enforcement: Establish policies that prohibit complex chained or nested shell commands in automated LLM-assisted workflows unless they pass through stricter review paths. Automated checks in CI or pre-commit hooks can scan for risky patterns in scripts that rely on rtk.
  • Runtime monitoring: Instrument logs around permission decisions to capture the original command, the rewritten form, and the authorization outcome. Look for cases where commands with multiple execution constructs are marked as "allowed" solely because they start with a trusted prefix.
  • Automated review tools: Use security linters or shell analyzers that recognize composite commands and can highlight where tool-specific authorization wrappers (like rtk) do not align with actual execution semantics.

Sources

SourceLink
github.comgithub.com/rtk-ai/rtk/security/advisories/GHSA-7gxq-fvfc-g327

Frequently asked

questions

Exploitability depends on how rtk is integrated. It is most impactful in workflows where users or automation submit shell commands through rtk and rely on its permission checks as a safety barrier. In such setups, someone able to craft command lines can smuggle secondary commands past the authorization logic.

An attacker must be able to provide or influence command input processed by rtk—for example, through a terminal session, a script that delegates execution to rtk, or an LLM toolchain that uses rtk for command filtering. No deeper system-level privileges are necessary beyond this ability to submit commands.

The safest fix pattern is to adopt conservative, semantics-aware parsing of shell commands and apply authorization to every execution boundary, not just the leading token. Commands containing multiple separators or nesting constructs should either be rejected outright, broken into individually authorized segments, or gated behind explicit user confirmation.

Future tooling should treat command authorization as a full semantic analysis problem: understand all execution paths, avoid relying on simple prefixes or rewrites as safety indicators, and enforce least-privilege policies. Incorporating robust shell parsing libraries, security-focused code review, and policy-based checks in CI can help prevent incomplete permission logic from reaching production.

Find out what's already
exploitable in your codebase.