/

CVE-2026-48703

Severity:

HIGH RISK

(7.8)

OS Command Injection (CWE-78) in Warp Agent Tools

CVE-2026-48703

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Unintended Command Execution in User Terminal

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

Warp Agent code search tools contain an OS command injection flaw where Grep and FileGlob actions build shell commands directly from agent-controlled inputs and execute them in the active terminal.

When agents or tools can influence search text, paths, or glob patterns, this vulnerability can lead to unintended command execution and compromise of the developer's local environment.

Affected context

This vulnerability occurs in Warp's agentic development environment when Agent code search tools (Grep and FileGlob) are permitted to run within an active terminal session.

It manifests in workflows where agents are trusted to construct search queries or file patterns, and their inputs are turned into shell commands without sufficient validation or isolation.

The risk is elevated when agents consume untrusted project content, external prompts, or tool outputs that can influence the search parameters passed to the terminal.

Exploit preconditions

  • Attack surface: Agent code search operations (Grep and FileGlob) running in a Warp terminal.
  • Required access: Ability to control or influence agent inputs such as search strings, file paths, or glob patterns (directly or via upstream data/prompt injection).
  • Trigger point: Execution of the Agent's search action, which constructs shell command strings and runs them in the user's active terminal session.
  • Why exploitation is possible: The implementation treats agent-controlled parameters as trusted, interpolating them into shell commands without robust sanitization, escaping, or command separation, allowing injected shell syntax to be executed.

Why this happens

The underlying issue is a classic OS command injection pattern: application logic constructs shell commands by concatenating untrusted data and executes them without strict validation or escaping.

In Warp's Agent code search tools, Grep and FileGlob actions are conceptually read-only, but their implementations still rely on shell command execution, directly embedding agent-controlled inputs into the command line.

This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where user- or agent-supplied strings can introduce shell metacharacters or additional commands that the system executes.

Potential impact

  • Agent-controlled inputs may cause arbitrary commands to run in the user's terminal session.
  • Attackers could read or exfiltrate local files accessible to the terminal's user.
  • Malicious commands could modify project source code or configuration files.
  • Local environment integrity and tooling configurations can be tampered with.
  • In some setups, injected commands may install additional tooling or backdoors for later misuse.

General mitigation guidance

Effective mitigation focuses on eliminating direct command construction from untrusted inputs and tightening trust boundaries around agent operations.

Recommended patterns include:

  • Prefer parameterized, non-shell APIs (e.g., library calls for search and filesystem traversal) instead of building shell strings.
  • When shell usage is unavoidable, strictly escape or validate all input, rejecting or constraining shell metacharacters and control operators.
  • Treat agent-provided data as untrusted, enforcing strong input validation and limiting the set of allowed actions to clearly read-only operations.
  • Run agent actions within a constrained execution context, such as sandboxed environments or minimal-permission sessions, reducing the blast radius of unexpected commands.
  • Design policies that differentiate between "read/search" and "execute" capabilities, ensuring that tools labeled as read-only cannot trigger arbitrary command execution.

How teams detect issues like this

Detection can rely on both proactive and reactive techniques:

  • Static analysis and code scanning rules targeting string concatenation or interpolation paths that feed into shell execution APIs (e.g., system calls, subprocess runners).
  • Code review checklists that flag use of shell commands in components advertised as read-only, and require explicit justification and safety measures.
  • Policy enforcement in CI/CD or internal tooling that rejects or warns on insecure command construction patterns, especially in agent-related or automation code.
  • Runtime monitoring and logging that record executed commands originating from agent workflows, allowing teams to spot anomalous or unexpectedly complex command lines.

Sources

SourceLink
github.comgithub.com/warpdotdev/warp/commit/43f4f483e0c2dd253d2aaa8a495b2d71f0208c40
github.comgithub.com/warpdotdev/warp/security/advisories/GHSA-8r78-7jwh-m6hm

Frequently asked

questions

It can be indirectly exploitable when remote inputs (e.g., prompts, external data, or upstream tools) influence agent behavior and cause the construction of malicious search parameters, but it ultimately executes commands on the local machine running Warp.

An attacker needs the ability to control or significantly influence the data given to the Agent's search tools—such as prompt content, project files consumed by the agent, or upstream tool outputs that the agent treats as command parameters.

The safest pattern is to remove direct shell command construction from agent-controlled inputs and replace it with safe, parameterized APIs for search and file operations, backed by strict input validation and clear separation between read-only and executable actions.

Prevent them by treating all agent-generated or agent-consumed data as untrusted, enforcing strong validation and escaping, favoring non-shell APIs, sandboxing agent actions, and embedding security reviews and automated checks into the design of tools that interact with terminals or operating system commands.

Find out what's already
exploitable in your codebase.