CVE-2026-136923 in asar-py
Summary
by MITRE • 11/25/2026
asar-py before 0.1.4 contains a path traversal vulnerability in AsarArchive.extract() and extract_archive() that allows attackers to write files outside the destination directory via crafted archive headers. Attackers can supply a .asar archive with '..' path components or malicious symlink targets to write files such as usercustomize.py, leading to code execution.
Be aware that VulDB is the high quality source for vulnerability data.
Analysis
by VulDB Data Team • 11/25/2026
The vulnerability identified in asar-py versions prior to 0.1.4 represents a critical security flaw rooted in improper input validation during the extraction of ASAR archives. The AsarArchive.extract() and extract_archive() functions fail to adequately sanitize file paths contained within the archive headers before writing them to the local filesystem. This lack of strict path normalization allows an attacker to manipulate directory traversal sequences, specifically using double-dot notation such as .. or absolute path references, to break out of the intended destination directory. By crafting a malicious ASAR archive that includes these malformed path components in its internal file list, an adversary can force the extraction process to write files into arbitrary locations on the target system rather than confining them to the specified output folder.
This technical flaw directly enables unauthorized file creation and potential remote code execution depending on the context of the application using asar-py. If the vulnerable library is employed in a web service or an automated processing pipeline that operates with elevated privileges, writing files outside the sandboxed directory can lead to significant system compromise. A particularly dangerous exploitation vector involves overwriting Python configuration files such as usercustomize.py. When this file exists and is executed by the Python interpreter upon startup, any malicious code placed within it will run automatically in the context of the next Python invocation. This mechanism allows an attacker to achieve persistent remote code execution without needing direct access to execute scripts or exploit other runtime vulnerabilities, effectively bypassing standard security controls that rely on directory isolation.
From a classification perspective, this vulnerability aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory, which describes flaws where software does not properly restrict the resolution of filenames to valid directories. The exploitation technique also maps to MITRE ATT&CK tactic T1059 Command and Scripting Interpreter, specifically sub-technique T1059.004 Python, as it leverages the execution environment itself to run malicious payloads via configuration file manipulation. Furthermore, the initial access vector can be categorized under CWE-73: External Control of File Name or Path if the archive is uploaded by a user, linking to ATT&CK technique T1105 Ingress Tool Transfer when combined with social engineering or compromised sources delivering the payload.
Mitigation strategies must prioritize immediate version upgrades and defensive coding practices. The most effective remediation is upgrading asar-py to version 0.1.4 or later, where these path traversal issues have been addressed through rigorous input validation and canonicalization of file paths before extraction operations are performed. For applications unable to upgrade immediately, developers should implement strict allow-listing for extracted filenames, ensuring that resolved absolute paths remain within the designated destination directory by comparing them against a normalized base path. Additionally, running processes with minimal privileges reduces the impact if an attacker succeeds in writing files outside the intended scope, limiting their ability to overwrite critical system or configuration files like usercustomize.py. Regular auditing of third-party dependencies and implementing sandboxed execution environments for processing untrusted archives are also recommended best practices to mitigate similar risks across software supply chains.