CVE-2026-137539 in lastversion
Summary
by MITRE • 11/26/2026
lastversion before 3.6.20 contains a path traversal vulnerability in extract_tar() that allows attackers to write files outside the extraction directory via tar symlink members. Attackers controlling a project's release assets can craft a tarball with a symlink followed by a file beneath it, writing files like usercustomize.py to achieve code execution.
Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.
Analysis
by VulDB Data Team • 11/26/2026
The identified vulnerability represents a critical path traversal flaw within the extract_tar() function of software versions preceding 3.6.20. This security defect stems from an insufficient validation mechanism when processing tar archive members that utilize symbolic links. In standard archival formats, symlinks are intended to point to other files or directories within the same container to save space and maintain directory structures. However, in this specific implementation, the extraction logic fails to properly resolve these symbolic link targets against a strict allowlist of permitted paths before proceeding with file creation operations. This oversight allows an attacker to construct a maliciously crafted tarball where a symlink is directed outside the designated extraction root directory. By leveraging relative path traversal sequences such as dot-dot-slash notation within the symlink target, the archive can force the system to write files into arbitrary locations on the host filesystem rather than confining them to the intended temporary or project-specific directories.
The operational impact of this vulnerability is severe because it directly facilitates unauthorized file writes and potential remote code execution. An attacker who controls a project's release assets, such as those distributed through package managers or official download channels, can embed these malicious archives within legitimate-looking releases. When an administrator or automated build system extracts the archive using the vulnerable version of the software, the path traversal allows the injection of files into sensitive directories like Python site-packages or user home directories. Specifically, the ability to write a file named usercustomize.py is particularly dangerous in Python environments because this module is automatically imported during interpreter startup if it exists in certain paths. By placing a malicious script with this name via the symlink trick, an attacker can ensure that arbitrary code executes every time the Python environment initializes, effectively gaining persistent control over the system without requiring direct command-line access or elevated privileges at the moment of execution.
From a classification perspective, this vulnerability aligns closely with CWE-22: Improper Limitation of a Pathname to a Restricted Directory, which describes flaws where software does not properly neutralize special elements within file paths that can cause files to be located outside of the intended directory. Furthermore, in terms of tactical behavior, this attack vector maps to ATT&CK technique T1505.003: Server Software Component: Web Shell or more broadly T1195: Supply Chain Compromise if the release assets are compromised by a third party. The exploitation relies on the trust placed in archived data and the automatic execution behaviors of specific runtime environments, highlighting the risks associated with processing untrusted input from external sources without rigorous sanitization.
To mitigate this vulnerability, organizations must immediately upgrade to version 3.6.20 or later where the extract_tar() function has been patched to enforce strict path canonicalization before file operations occur. During the transition period, it is advisable to implement defensive coding practices such as validating that all extracted files reside within an expected base directory by comparing their real paths against a whitelist of allowed prefixes. Additionally, security teams should audit release asset pipelines for integrity and authenticity using cryptographic signatures to prevent tampering with distribution artifacts. For environments relying on Python interpreters, restricting the execution context or disabling automatic import of usercustomize.py in untrusted contexts can provide an additional layer of defense against code injection attempts that exploit similar path traversal weaknesses in other software components.