HIGH 8.0

CVE-2026-23879: py7zr Arbitrary File Write via Symlink Path Traversal

py7zr is a Python library used to work with 7zip archives. A flaw in versions 1.1.2 and earlier allows an attacker to craft a malicious archive containing symbolic links that, when extracted, write files outside the intended destination folder. By chaining symbolic links, an attacker can bypass the library's directory boundary protections and write arbitrary files to the system. This could lead to code execution, privilege escalation, or data corruption depending on what files are overwritten and where.

Source data · NVD / CISA · public domain

CVSS
3.1 · 8.0 HIGH · CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Weaknesses (CWE)
CWE-59
Affected products
0 configuration(s)
Published / Modified
2026-06-24 / 2026-06-25

NVD description (verbatim)

py7zr is a Python-based library and utility to support 7zip archive compression, decompression, encryption and decryption. Versions 1.1.2 and below contain an an arbitrary file write vulnerability, which allows symbolic links to be recreated outside the destination directory via crafted malicious symbolic link chains. When using extractall to extract an archive, the library restores these symbolic links, linking them to arbitrary directories on the host file system. During extraction, the program only checks the link arcname within the destination directory, but ignores the combined symlink path resolution. Attackers can exploit this vulnerability by constructing malicious archives, thereby bypassing the directory boundary restrictions implemented by the extractor. Subsequent extraction of regular files through these symbolic links can result in arbitrary file writes. This vulnerability may lead to remote code execution, privilege escalation, data corruption, or denial of service. This issue has been fixed in version 1.1.3.

3 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-23879 is a path traversal vulnerability in py7zr that exploits improper symlink validation during archive extraction. The vulnerability exists because the extractall() method validates only the symbolic link's arcname (its path within the archive) against the destination directory, but fails to resolve and validate the final target path after symlink dereferencing. An attacker crafts an archive containing symlink chains that, when followed, resolve to paths outside the destination directory. Subsequent extraction of regular files through these symlinks results in writes to arbitrary filesystem locations. The vulnerability is classified as CWE-59 (Improper Link Resolution Before File Access).

Business impact

Organizations using py7zr to process untrusted or user-supplied 7zip archives face significant risk. A successful exploit could result in arbitrary code execution if an attacker overwrites executable files or configuration files loaded at runtime, privilege escalation if sensitive system files are modified, wholesale data corruption, or denial of service through filesystem manipulation. The impact is amplified in automated environments (CI/CD pipelines, backup systems, file processing services) where extraction happens without interactive oversight.

Affected systems

Any system running py7zr version 1.1.2 or earlier is affected. This includes Python applications, command-line tools, and containerized services that depend on py7zr for archive handling. The vulnerability requires an attacker to control the archive being extracted, making it most dangerous in scenarios involving untrusted uploads, downloads from external sources, or supply chain attack vectors.

Exploitability

The vulnerability has a CVSS 3.1 score of 8.0 (HIGH) with vector CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H. Exploitation requires network access, low attack complexity, and a user with login privileges to perform the extraction (e.g., a system administrator or process running with elevated rights). User interaction is required—specifically, the user must trigger extraction of a malicious archive. The attack does not cross security boundaries; it operates within the security context of the extracting process. This is not currently listed on CISA's Known Exploited Vulnerabilities catalog.

Remediation

Upgrade py7zr to version 1.1.3 or later, which implements proper symlink target validation. Organizations should audit their codebase for use of py7zr's extractall() function and prioritize patching systems that process archives from untrusted sources. Until patching is complete, consider restricting archive extraction to isolated environments, validating archive contents before extraction, or implementing strict filesystem access controls.

Patch guidance

Update py7zr via your package manager. For pip-based environments, run 'pip install --upgrade py7zr>=1.1.3'. Verify the updated version by checking the library version in your application's dependency management system. Test extraction workflows in a non-production environment before deploying to production systems to ensure compatibility.

Detection guidance

Monitor process execution and filesystem activity for suspicious patterns: extraction of archive files followed by unexpected writes to directories outside the intended extraction path, creation of symbolic links within archive processing workflows, or modification of system binaries or configuration files immediately after archive extraction. Log all invocations of extractall() and correlate with filesystem modification events. Consider implementing file integrity monitoring on critical directories to detect unauthorized changes.

Why prioritize this

This vulnerability merits urgent attention due to its HIGH severity rating, the ease of exploitation (network-accessible, low complexity), and the potential for critical impact including remote code execution and privilege escalation. The requirement for legitimate user privileges and user interaction slightly reduces urgency in fully automated systems, but organizations with human-driven archive handling or services that process user uploads should treat this as critical. The absence of active exploitation in the wild does not diminish the threat—proactive patching is essential.

Risk score, explained

The CVSS 8.0 score reflects the combination of network accessibility, direct impact to confidentiality and integrity, high attack complexity, and the need for user interaction. While the attacker needs login privileges and user action to trigger extraction, the consequences—arbitrary file write leading to code execution—are severe. The score appropriately prioritizes this as a high-risk issue requiring swift remediation.

Frequently asked questions

Does upgrading to 1.1.3 require code changes on my end?

No. Version 1.1.3 is a drop-in replacement for earlier versions. Simply upgrade the package and redeploy. Your extraction code will automatically benefit from the improved symlink validation without modification.

How can I test if our archives are affected before extraction?

Examine the archive structure for suspicious symbolic links that resolve outside the archive's directory tree. Use standard archive inspection tools (e.g., 7z l, unzip -l) to list contents and symlink targets. However, the safest approach is to upgrade first and only then process untrusted archives.

What if we only extract archives from internal, trusted sources?

While internal sources are generally lower-risk, you should still upgrade to 1.1.3 to prevent supply chain attacks or compromised internal systems from exploiting this vulnerability. Patching is a minimal operational cost with significant security benefit.

Is there a way to safely extract from untrusted archives without upgrading?

Extract archives in an isolated, disposable environment (container, virtual machine) with minimal filesystem permissions, and validate the extracted contents before using them. However, this is not a substitute for patching. Upgrade as soon as feasible.

This analysis is based on the CVE description and CVSS vector as published. Patch availability, deployment timelines, and organizational impact may vary. Always verify patch compatibility and test in non-production environments before deployment. For the most current advisory information, consult the py7zr project repository and vendor security bulletins. Source: NVD (public-domain), retrieved 2026-08-02. Analysis generated by SEC.co (claude-haiku-4-5).