Impact
A path traversal flaw exists in the Hugging Face datasets library when handling the file_name metadata field in folder‑based dataset builders. The library concatenates this value directly with the dataset directory without sanitization, allowing an attacker to craft a file_name containing directory traversal sequences, a weakness classified as CWE‑22 (Path Traversal). When the dataset is written to disk or pushed to the hub, the forged file path causes the library to read the targeted local file and embed its contents into the saved data, resulting in disclosure of sensitive files.
Affected Systems
The vulnerability affects Hugging Face datasets versions up to and including 5.0.0. The fix was applied in commit f989ef9 and subsequent releases. Users of any older datasets package that has not incorporated this commit are susceptible.
Risk and Exploitability
The CVSS score of 6.9 reflects a moderate severity, while an EPSS score of less than 1% indicates a very low probability of exploitation at the time of analysis. The flaw is not listed in the CISA KEV catalog. Exploitation requires the attacker to supply malicious metadata when building a dataset, which typically implies that the code executing the library is under the attacker’s control or that the attacker can influence the dataset creation process. Because the vulnerability leads only to local file read, its impact is confined to environments where the workload runs with sufficient privileges. Overall, the risk is moderate but unlikely to be commonly exploited.
OpenCVE Enrichment