Summary
Tabby terminal before version 1.0.234 unsafely injects dropped file paths into the active shell without sanitizing command substitution characters.
An attacker who can trick a user into dropping a crafted filename into a Tabby session may achieve arbitrary command execution when the victim presses Enter.
Affected context
The vulnerability occurs in Tabby (formerly Terminus) terminal emulator when handling drag-and-drop of files into an active terminal session.
When a user drags a file with a specially crafted name onto the Tabby window, the application inserts that path directly into the shell input line.
In affected versions, characters used for command substitution such as $(...) and backticks are not neutralized, so the shell interprets them as part of a command rather than as a literal path.
The risk is present primarily in interactive sessions where users frequently drag and drop files into the terminal for convenience.
Exploit preconditions
- Attack surface: Local desktop environment via Tabby's drag-and-drop file path handling.
- Required access: Ability to influence or control the filenames a Tabby user might drag into the terminal (e.g., shared folders, downloads, archives, or links to maliciously named files).
- Trigger point: The victim drags a maliciously named file into an active Tabby shell and then presses Enter, causing the inserted text to be executed by the shell.
- Why exploitation is possible: Tabby passes dropped file paths directly to the shell without escaping or neutralizing command substitution metacharacters, allowing the shell to interpret parts of the filename as executable syntax.
Why this happens
This issue stems from treating externally influenced text as trusted shell input without proper escaping.
The pathDrop handling code constructs a shell command line by interpolating the dropped file path verbatim, failing to sanitize or quote characters that have special meaning in shells (such as $, backticks, and command substitution syntax).
This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), and is closely related to CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection').
Conceptually, any UI feature that bridges user-controlled data (filenames, clipboard contents, drag-and-drop payloads) into a command interpreter must enforce strict neutralization or literalization of special characters; failing to do so exposes the shell as an unintended execution engine.
Potential impact
- Execution of arbitrary shell commands under the privileges of the Tabby user.
- Exfiltration, modification, or deletion of files accessible to the user account.
- Installation of additional malware or persistence mechanisms on the user's system.
- Lateral movement within the user's environment (e.g., accessing SSH keys or remote systems).
- Compromise of sensitive credentials stored in configuration files or environment variables.
General mitigation guidance
Effective mitigation centers on treating all path-like inputs as data and not as shell syntax.
Common defensive patterns include:
- Wrapping dropped file paths in strict, language-appropriate quoting or using APIs that pass arguments as arrays instead of interpolated command strings.
- Explicitly escaping or neutralizing shell metacharacters (e.g.,
$, backticks,;,&, pipes, parentheses) when constructing command lines. - Designing the drag-and-drop behavior so that file paths are inserted as literal text into the terminal UI, without any additional shell-specific decoration or expansion.
- Applying the principle of least surprise: avoid automatically executing or preparing dropped content in a way that changes its meaning in the shell.
- Using secure-by-default utility functions or libraries for command construction rather than crafting shell strings manually.
How teams detect issues like this
Detection typically involves reviewing how the application builds and forwards shell input:
- Static analysis: Search for code paths that concatenate or interpolate user-controlled values (such as filenames, drag-and-drop payloads, clipboard content) into shell command strings or terminal input without quoting or escaping.
- Code review: Examine UI interaction handlers (e.g., drag-and-drop, copy/paste, context menus) to ensure they treat external data as literal and do not rely on shell parsing semantics.
- Policy enforcement: Establish coding guidelines that forbid direct string-based command construction when user-controlled input is involved, and require use of safe wrappers or argument-array APIs.
- Automated tooling: Integrate linters or security scanners that flag dangerous patterns like unescaped insertion of external data into shell commands or terminal buffers.

