Executive brief
Cornac, a Python library for recommendation systems, is vulnerable to a security flaw that allows unauthorized file creation on a user's system. When the library downloads and extracts dataset archives, a specially crafted file could trick the software into writing data to sensitive locations outside of the intended folder. This could allow an attacker to overwrite system files or application code, potentially leading to a full system compromise or service disruption.
Technical details
A path traversal vulnerability, commonly known as 'Tar Slip', exists in Cornac's `_extract_archive()` function within `cornac/utils/download.py`. The vulnerability stems from the insecure use of `archive.extractall()` on TAR archives without validating the destination paths of the archive members. An attacker can provide a malicious TAR archive containing `../` sequences, absolute paths, or symlink/hardlink entries to write files to arbitrary locations on the filesystem with the permissions of the running process. This is reachable via built-in dataset loaders that automatically download and extract archives. The issue is fixed in version 2.6.0 by implementing a hardened extraction process that validates paths and restricts file types.
Affected products
- PreferredAI Cornac < 2.6.0
Timeline
- 2026-06-24: other: Initial fix commits authored
- 2026-07-14: patched: Fix merged into master branch via Pull Request #709
- 2026-07-15: advisory: NVD and VulnCheck advisories published
- 2026-07-15: other: Version 2.6.0 released