CVE-2026-59974
Path traversal in stanza unzip allows arbitrary file overwrite
- CVSS 7.8
- 22
- Input Validation and Sanitization
- Remote
Stanza is a Stanford NLP Python library for tokenization, sentence segmentation, NER, and parsing of many human languages. Prior to 1.14.0, stanza.resources.common.unzip in stanza/resources/common.py passes downloaded model and resource archives to zipfile.ZipFile.extractall without validating member paths, and the vulnerable extraction path is reachable through stanza.download and stanza.install_corenlp. A malicious archive containing parent-directory traversal entries can write outside the intended model directory, allowing files writable by the Stanza process to be overwritten and potentially enabling code execution through modified shell configuration, SSH authorization data, Python packages, or executable scripts. This issue is fixed in version 1.14.0.
- CWE
- 22
- CVSS base score
- 7.8
- Published
- 2026-09-16
- OWASP
- A04 Insecure Design
- Orthogonal defect classification
- Checking
- Code defect classification
- Missing Check
- Category
- Input Validation and Sanitization
- Subcategory
- Path Traversal
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- Stanza
- Fixed by upgrading
- Yes
Solution
Upgrade Stanza to version 1.14.0 or newer.
Vulnerable code sample
import os
import zipfile
def unzip_archive(archive_path, target_dir):
"""Extract a zip archive to target_dir without path validation."""
with zipfile.ZipFile(archive_path, 'r') as zip_ref:
# VULNERABLE: unsafe extractall allows path traversal
zip_ref.extractall(target_dir)Patched code sample
import os
import zipfile
def unzip_archive(archive_path, target_dir):
"""Extract a zip archive to target_dir with path validation."""
with zipfile.ZipFile(archive_path, 'r') as zip_ref:
# FIX: validate member paths to prevent traversal
for member in zip_ref.infolist():
member_path = os.path.normpath(os.path.join(target_dir, member.filename))
if not member_path.startswith(os.path.abspath(target_dir) + os.sep):
raise Exception("Unsafe path detected in zip entry")
zip_ref.extractall(target_dir)Payload
__VAITP_MODEL_REFUSED__
Cite this entry
@misc{vaitp:cve202659974,
title = {{Path traversal in stanza unzip allows arbitrary file overwrite}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-59974},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-59974/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
