Summary
Certain versions of Warp improperly trust non-inline OSC 1337;File escape sequences emitted by terminal output, automatically creating local files without user confirmation.
If a user runs commands that produce crafted terminal output, this can lead to unexpected file materialization, potentially overwriting or planting files in the local environment.
Affected context
This issue occurs in Warp's handling of OSC 1337;File terminal control sequences for file transfer and display.
When Warp is used to run commands that emit non-inline OSC 1337;File payloads, the client automatically decodes and materializes these payloads as files on the local system without an explicit user approval step.
The vulnerability is relevant in interactive sessions where users execute scripts, remote tools, or third-party utilities that can control terminal output and may embed such payloads.
Exploit preconditions
- Attack surface: Terminal output rendered in Warp.
- Required access: Ability to cause the Warp terminal to display crafted escape sequences (e.g., via executed commands, remote shells, or scripts).
- Trigger point: Emission of a non-inline
OSC 1337;Filepayload in terminal output that Warp interprets as a file transfer command. - Why exploitation is possible: Warp implicitly trusts and processes these escape sequences, decoding and writing the referenced payload to disk without validating intent or requiring user confirmation.
Why this happens
The root cause is insufficient validation and trust management of control sequences used for file transfer in the terminal protocol.
Warp treats non-inline OSC 1337;File payloads as benign instructions and automatically materializes the associated data as local files, failing to distinguish between trusted, user-initiated operations and arbitrary terminal output.
This maps to CWE-73: External Control of File Name or Path, as external data dictates which files are created or modified, and to CWE-20: Improper Input Validation, since the client does not adequately constrain or authorize the processing of these escape sequences before performing file-system operations.
Potential impact
- An attacker-controlled command output may create unexpected files in the user's environment.
- Terminal output can overwrite or modify existing files, depending on where payloads are placed.
- Malicious files (e.g., scripts or configuration artifacts) could be planted to influence subsequent tooling or workflows.
- Users may be misled by silently created files, impacting the integrity of local projects or development environments.
General mitigation guidance
Mitigation generally focuses on tightening the trust boundary around terminal escape sequences and file transfer mechanisms.
Effective patterns include:
- Treating
OSC 1337;Fileand similar control sequences as potentially untrusted input and requiring explicit user consent before writing files. - Restricting file creation and modification to clearly scoped, user-approved directories rather than arbitrary paths.
- Introducing robust validation for any externally controlled file metadata (such as names and locations), rejecting or sanitizing values that do not conform to safe patterns.
- Applying least-privilege principles to client-side file operations, limiting the ability of terminal protocols to affect sensitive files or configuration assets.
How teams detect issues like this
High-level detection approaches involve:
- Reviewing terminal client code paths that interpret escape sequences or protocol messages to identify direct file-system writes without authorization checks.
- Using static analysis or linting rules to flag code that handles externally controlled file names or paths without validation or user interaction.
- Implementing security-focused code review guidelines around terminal protocol handling, especially for features that create or modify local files.
- Monitoring for unusual or unexpected files appearing in development environments after terminal sessions, potentially aided by local integrity or audit mechanisms.

