CVE-2026-66007 in Datasets
Summary
by MITRE • 07/24/2026
Datasets through 5.0.0, fixed in commit f989ef9, contains a path traversal vulnerability in folder-based dataset builders where the file_name metadata field is not properly validated before being joined to the dataset directory. Attackers can supply crafted file_name values with directory traversal sequences to read arbitrary local files, which are then embedded into output when save_to_disk or push_to_hub is called.
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 07/25/2026
This vulnerability exists within datasets library versions through 5.0.0 and represents a classic path traversal flaw that enables unauthorized file access through maliciously crafted metadata inputs. The issue specifically affects folder-based dataset builders where the file_name metadata field undergoes insufficient validation before being concatenated with the dataset directory path. When attackers supply crafted file_name values containing directory traversal sequences such as ../ or ..\, they can manipulate the file system paths to access arbitrary local files that should remain protected from external access.
The technical implementation of this vulnerability stems from improper input sanitization and path construction practices within the dataset builder components. The vulnerability operates at the file system level where user-provided metadata is directly used in file path operations without adequate security checks or normalization. This allows attackers to escape the intended dataset directory boundaries and access files outside of the expected scope. The flaw becomes exploitable when the save_to_disk or push_to_hub functions are invoked, as these operations process the maliciously constructed paths and embed the contents of the targeted files into the output artifacts.
The operational impact of this vulnerability is significant as it can lead to data exposure and potential information disclosure attacks. An attacker could potentially access sensitive configuration files, authentication credentials, system logs, or other confidential data stored on the same system hosting the dataset builder. The vulnerability affects any environment where datasets library is used with user-provided metadata, particularly in scenarios involving collaborative data processing or cloud-based dataset management systems. This creates a persistent risk for organizations that rely on automated dataset building processes without proper input validation mechanisms.
Mitigation strategies should focus on implementing robust input validation and path sanitization measures within the dataset builder components. The fix implemented in commit f989ef9 demonstrates the importance of normalizing file paths and validating user inputs before they are used in file system operations. Organizations should ensure that all metadata fields containing file names undergo proper sanitization using established security libraries or custom validation routines that prevent directory traversal sequences from being processed. Implementing principle of least privilege access controls and regular input validation audits can help prevent similar vulnerabilities from emerging in other components of data processing pipelines.
This vulnerability aligns with CWE-23 Path Traversal and CWE-77 Path Traversal issues, representing a common security weakness in file system path handling. The attack pattern follows ATT&CK technique T1059 Command and Scripting Interpreter where attackers leverage path traversal to access unauthorized files. The implementation of proper input validation and secure coding practices for file operations is essential to prevent exploitation of similar vulnerabilities across data processing frameworks and libraries.