/

CVE-2026-48719

Severity:

HIGH RISK

(8.0)

Command Injection (CWE-78) in Warp Prompt Branch Selector

CVE-2026-48719

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution

Severity:

HIGH RISK

(8.0)

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 command injection vulnerability in Warp's prompt branch selector allows crafted Git branch names to be interpreted directly by the victim's shell.

If an attacker can publish maliciously named branches to a repository opened in Warp and the victim selects that branch via the UI, arbitrary commands may run under the victim's account.

Affected context

This vulnerability arises when Warp is used with Git repositories whose branch names are surfaced into the interactive prompt or branch selector UI.

The issue is relevant in workflows where developers regularly switch branches from within Warp, and where branch names from a shared or multi-user repository are not treated as untrusted input.

The risk is higher in collaborative environments or CI-related repos where multiple users can push branches that others may later select in Warp.

Exploit preconditions

  • Attack surface: Warp prompt branch selector and underlying shell integration.
  • Required access: Ability to publish or push branches with attacker-controlled names to a Git repository opened in Warp by the victim.
  • User interaction: The victim must select the malicious branch from Warp's branch selector UI, causing the crafted name to be integrated into a shell-related command.
  • Why exploitation is possible: The branch name is incorporated into shell commands without adequate sanitization or escaping, allowing shell metacharacters in the branch name to be interpreted by the shell.

Why this happens

The root cause is improper handling of untrusted data (Git branch names) that is later passed to a command interpreter without strict sanitization or escaping.

Warp's branch selector functionality appears to construct shell commands or prompt content using branch names, relying on default shell parsing rather than treating the names strictly as data.

This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where user-controlled strings containing shell metacharacters influence command execution.

Potential impact

  • Arbitrary command execution in the victim's shell session.
  • Unauthorized access to local files and sensitive developer data.
  • Exfiltration of SSH keys, API tokens, or other credentials accessible from the developer environment.
  • Installation of backdoors or malicious tooling in the development workstation.
  • Modification of repository contents or local configuration to enable follow-on attacks.

General mitigation guidance

Mitigation generally focuses on preventing untrusted strings from being interpreted by the shell and tightening how UI-sourced data flows into command construction.

Recommended defensive patterns include:

  • Treating branch names and similar repository metadata strictly as data, never as part of executable shell syntax.
  • Applying robust escaping or neutralization routines before inserting branch names into shell commands or prompts, aligned with the target shell's quoting rules.
  • Using parameterized execution APIs (e.g., subprocess with argument lists) instead of building command strings for the shell to parse.
  • Enforcing least-privilege for the shell environment and avoiding unnecessary implicit execution paths from UI interactions.
  • Establishing safe defaults where UI actions perform simple, deterministic commands with constrained, validated inputs.

How teams detect issues like this

Detection commonly involves a mix of code-level and workflow-level checks:

  • Static analysis rules targeting string concatenation into shell commands, particularly where repository metadata (branch names, tags, remotes) is involved.
  • Code reviews focused on UI-to-shell integrations, looking for direct interpolation of untrusted values into command lines or prompt templates.
  • Security tests that attempt to use specially crafted branch names containing shell metacharacters to see if they affect execution behavior.
  • CI policies requiring automated scanning of shell wrappers, terminal integrations, and developer tooling for potential command injection patterns.

Sources

SourceLink
github.comgithub.com/warpdotdev/warp/commit/4295ec08d01912fe355351547e541277f29288cd
github.comgithub.com/warpdotdev/warp/security/advisories/GHSA-hgvx-4xvm-39pw

Frequently asked

questions

Exploitation depends on access to a Git repository that the victim opens in Warp and the victim's willingness to select a malicious branch name from the UI. In shared repositories or open collaboration environments, this can be a realistic scenario.

No. The attacker only needs the ability to push or publish branches to a repository used by the victim. The victim's interaction with Warp's branch selector provides the necessary local execution path.

The safest pattern is to ensure all branch names and similar metadata are treated as opaque data and rigorously escaped or quoted before being passed to shell or command execution APIs, ideally using parameterized execution rather than shell command strings.

Teams can audit UI-to-shell integrations for any string interpolation, enforce secure coding guidelines that prohibit building command lines from untrusted input, use static analysis to flag risky patterns, and design features so that user-driven actions rely on well-defined, parameterized operations instead of free-form shell commands.

Find out what's already
exploitable in your codebase.