CVE-2026-137569 in xtractr
Summary
by MITRE • 11/26/2026
Golift xtractr before 0.4.1 contains a path traversal vulnerability that allows attackers to write files outside the extraction root because a strings.HasPrefix output directory check lacks separator awareness. Attackers can supply ZIP, TAR, 7z, RAR, or other archives with entries like ../<outputdir>_evil/file to create or overwrite files in sibling directories.
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 11/26/2026
The vulnerability identified in Golift xtractr prior to version 0.4.1 represents a critical path traversal flaw rooted in insufficient validation of archive entry paths during the extraction process. This security defect allows an attacker with the ability to supply malicious archives to write files outside the intended extraction root directory, potentially leading to arbitrary file creation or overwriting on the host system. The core technical issue lies in the implementation of the output directory check, which relies exclusively on a strings.HasPrefix function to verify that the extracted path begins with the designated safe base directory. This approach is fundamentally flawed because it lacks separator awareness, meaning it fails to account for directory boundary characters such as forward slashes or backslashes. Consequently, an attacker can craft archives containing entries like ../<outputdir>_evil/file, where the relative path traversal sequences escape the intended sandbox and land in a sibling directory that shares a common prefix with the extraction root but is not actually contained within it.
From a technical perspective, this vulnerability exploits the difference between string prefix matching and proper filesystem path normalization. When an archive entry contains parent directory references such as dot-dot-slash sequences, standard secure practices require resolving these relative paths to their absolute canonical form before performing any access control checks. By skipping this resolution step or relying on naive string comparison, the application assumes that a path starting with /var/data/ is safe even if it resolves to /var/data_evil/file due to the lack of separator validation. This oversight permits the manipulation of file system structures beyond the scope intended by the administrator or user, violating the principle of least privilege and confinement expected from archive extraction utilities. The vulnerability affects support for multiple archive formats including ZIP, TAR, 7z, and RAR, indicating that the flaw exists in a shared code path rather than being isolated to a specific format handler.
The operational impact of this vulnerability is significant depending on the context in which Golift xtractr operates. If the application runs with elevated privileges or has write access to sensitive system directories, an attacker could overwrite configuration files, inject malicious scripts into web-accessible directories, or disrupt service availability by corrupting critical data files. In scenarios where multiple users share a file processing environment, this flaw enables cross-user contamination, allowing one user to interfere with another's workspace by writing files into their respective output folders through sibling directory traversal. This can lead to unauthorized access to sensitive information if the overwritten files contain confidential data or if the injected code is subsequently executed within the application context. The ability to create arbitrary files also facilitates further attacks such as web shell deployment, log injection for evasion purposes, or denial of service by filling up disk space in critical partitions.
To mitigate this vulnerability, it is essential to implement robust path canonicalization before performing any file system operations. Developers should resolve all relative paths using standard library functions that normalize the directory structure and eliminate parent directory references like dot-dot-slash sequences. The validation logic must ensure that the final resolved absolute path strictly begins with the intended extraction root followed by a separator character, rather than just matching the prefix string. Additionally, employing allowlists for permitted file extensions or restricting write permissions to specific subdirectories can provide defense-in-depth measures. Upgrading to version 0.4.1 or later of Golift xtractr is required as it addresses this flaw through improved path handling mechanisms that properly enforce directory boundaries and prevent escape from the designated extraction sandbox.
This vulnerability aligns with Common Weakness Enumeration identifier CWE-22, which describes Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal. It also maps to MITRE ATT&CK technique T1083, File and Directory Discovery, although in this case the primary impact is file manipulation rather than mere discovery. The lack of separator awareness highlights a common pitfall in security coding where string-based checks are used instead of semantic path validation. Organizations relying on Golift xtractr for automated archive processing should immediately apply patches or updates to ensure that extraction operations are confined to their intended directories, thereby maintaining the integrity and confidentiality of the underlying file system infrastructure.