Summary
A Zip Slip path traversal flaw in Streambert's subtitle extraction lets crafted ZIP archives escape the temporary directory during extraction.
When a user processes a malicious subtitle ZIP, an attacker may write arbitrary files anywhere the Streambert desktop app has filesystem write access.
Affected context
The vulnerability occurs in Streambert's subtitle download and extraction feature on the Electron desktop application.
It manifests when the app downloads a ZIP archive for subtitles and extracts it to a temporary directory without validating or normalizing the archive entry names.
Any environment where Streambert 2.4.0 or earlier is used to process untrusted subtitle ZIP files from external or remote sources is potentially affected, depending on the app's filesystem permissions.
Exploit preconditions
- Attack surface: Subtitle ZIP download and extraction workflow within the Streambert desktop application.
- Required access: Ability to cause Streambert to open or download a crafted ZIP archive (e.g., by hosting or supplying a malicious subtitle file).
- Trigger point: The moment Streambert extracts archive entries and constructs destination paths by concatenating the temporary directory path with the raw entry name.
- Why exploitation is possible: Entry filenames are not sanitized or canonicalized, so directory traversal sequences (e.g.,
../) in archive entries are honored, allowing writes outside the intended temporary directory.
Why this happens
The bug stems from building filesystem paths using unvalidated input from archive entry names and then writing files directly to those paths.
Instead of normalizing and checking that each extracted path remains within the intended temporary directory, the code concatenates tempDir + extracted.name and trusts it.
This aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory, reinforced by CWE-20: Improper Input Validation, because the application does not validate or constrain attacker-controlled path components from ZIP contents.
Potential impact
- Arbitrary file creation or overwrite anywhere on the filesystem accessible to the Streambert process
- Placement of malicious scripts, binaries, or configuration files to enable further compromise
- Tampering with user or application data, such as modifying settings or cache files
- Potential escalation to code execution if written files are later executed or interpreted by the system or other applications
- Interference with system stability by overwriting important non-executable files within the app's write scope
General mitigation guidance
Effective mitigation focuses on treating archive entry names as untrusted input and constraining extraction paths.
Common defensive patterns include:
- Normalizing and canonicalizing the target path and verifying it remains inside an expected root directory before writing any file.
- Rejecting archive entries containing
.., absolute paths, drive letters, or path separators that would escape the designated extraction directory. - Using high-level archive extraction utilities or libraries that provide built-in protection against Zip Slip and enforce directory boundaries by default.
- Running the application with least-privilege filesystem permissions so that even if a path traversal occurs, the write scope is significantly limited.
- Separating temporary extraction storage from sensitive application or user data directories.
How teams detect issues like this
Detection can rely on both code-centric and behavior-centric approaches:
- Static analysis rules that flag string concatenation of directory paths with unvalidated archive entry names or other user-controlled path components.
- Code review checklists explicitly calling out archive extraction logic, with reviewers verifying that canonical path checks constrain all writes to an allowed directory.
- Security unit tests or integration tests that include ZIP archives with
../sequences and absolute paths to ensure they are rejected or safely handled. - Runtime monitoring or EDR rules that detect unusual file creation patterns by the Streambert process, such as writes into unexpected system or configuration directories.
- Automated scanning tools configured to search for Zip Slip patterns in archive-handling code across the codebase.

