Summary
A path traversal vulnerability in Tabby's SFTP handling allows a malicious server to supply filenames containing backslash and parent-directory components. When a Windows user downloads or edits such entries, attacker-controlled content may be created or overwrite files outside the intended directory.
Affected context
The issue occurs in Tabby deployments before version 1.0.235 when the application connects to an untrusted or compromised SFTP server from Windows. SFTP entry names are processed using POSIX-style path logic and later passed to Windows-native path functions during recursive downloads or temporary-file editing, allowing path components that are harmless in one processing context to become traversal sequences in another.
Exploit preconditions
- Attack surface: Tabby's SFTP browsing, folder download, or remote-file editing functionality on Windows
- Required access: A user must connect to an SFTP server controlled or influenced by the attacker
- Trigger point: The client processes a server-provided entry name during recursive download or temporary edit preparation
- Why exploitation is possible: Backslashes and parent-directory components are preserved during initial path handling but are interpreted as separators and traversal elements by Windows-native path APIs
Why this happens
The underlying bug is inconsistent path normalization across platform-specific components. SFTP entry names are handled with POSIX path semantics, while later processing uses Windows path joining without rejecting separators or parent-directory components supplied by the remote server. This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, because attacker-controlled path data can escape an intended filesystem boundary.
Potential impact
- Attacker-controlled files may be created outside the selected download directory
- Existing files in accessible locations could be overwritten
- Temporary edit files may be written outside the intended workspace
- Local configuration, scripts, or user data may be modified
- The user or other local processes may consume attacker-controlled content
General mitigation guidance
Mitigation generally focuses on treating remote filenames as untrusted data and enforcing destination boundaries after platform-specific normalization.
Common defensive patterns include:
- Rejecting absolute paths, drive-qualified paths, alternate separators, and parent-directory components in remote entry names
- Constructing paths with platform-aware APIs and verifying that the canonical destination remains within the selected root
- Separating display names from filesystem paths and generating safe local names where appropriate
- Applying the same validation to downloads, recursive directory operations, and temporary edit paths
- Limiting local file permissions and avoiding unnecessary access to sensitive directories
- Using secure-by-default behavior that prevents writes when boundary validation is ambiguous
How teams detect issues like this
Organizations can look for path traversal risks through:
- Static analysis rules covering path joins that combine trusted roots with remote, archive, or network-provided names
- Code review checks for mixed POSIX and Windows path processing
- Tests containing backslashes, forward slashes, dot segments, absolute paths, drive prefixes, and encoded separator variants
- Runtime telemetry for file writes escaping approved download or temporary directories
- Policy enforcement requiring canonical containment checks before filesystem operations
- Automated security review tools that flag unchecked path construction and cross-platform normalization inconsistencies

