Description
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.
Published: 2026-07-24
Score: 6.9 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

Generated by OpenCVE AI on August 3, 2026 at 20:08 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the datasets library to the latest release that incorporates commit f989ef9. This removes the unsanitized handling of the file_name field.
  • If an immediate upgrade is not possible, sanitize the file_name metadata before passing it to the dataset builder or strip any path separator characters.
  • Implement a restriction that rejects any file_name containing directory separator characters or traversal sequences, and validate the resulting path against the intended dataset directory.

Generated by OpenCVE AI on August 3, 2026 at 20:08 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 27 Jul 2026 13:15:00 +0000

Type Values Removed Values Added
First Time appeared Huggingface
Huggingface datasets
Vendors & Products Huggingface
Huggingface datasets

Sat, 25 Jul 2026 11:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Fri, 24 Jul 2026 18:30:00 +0000

Type Values Removed Values Added
Description 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.
Title Datasets Path Traversal via Unsanitized file_name Metadata
Weaknesses CWE-22
References
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N'}

cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N'}


Subscriptions

Huggingface Datasets
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-07-25T10:30:06.287Z

Reserved: 2026-07-23T19:22:30.643Z

Link: CVE-2026-66007

cve-icon Vulnrichment

Updated: 2026-07-24T15:18:46.134Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-07-24T15:19:07.493

Modified: 2026-07-30T20:16:16.213

Link: CVE-2026-66007

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-03T20:15:04Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')