Hugging Face Datasets folder-based builders allow path traversal through file_name metadataGHSA-379c-qx7v-6h59
MEDIUMFix: huggingface/datasets#8325GHSA-379c-qx7v-6h59 is a medium-severity (CVSS 6.5) Path Traversal vulnerability in datasets. A fix is available for datasets — see the affected versions and patch details below.
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
Exploitation and automatability from CISA’s SSVC triage for GHSA-379c-qx7v-6h59.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
GHSA-379c-qx7v-6h59 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 394,803 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
datasetsReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | datasets | all versions | 5.0.1pip install --upgrade 'datasets==5.0.1' |
Affected Products
datasetshuggingfaceDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for datasets, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update datasets to 5.0.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-379c-qx7v-6h59 is resolved across your whole dependency graph.
Workarounds
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This path traversal vulnerability in the `datasets` library allows for information disclosure. An attacker could exploit this by providing specially crafted `file_name` metadata to a folder-based dataset builder, which, upon user interaction with `save_to_disk` or `push_to_hub` operations, could embed arbitrary local…
To mitigate this issue, ensure that all `file_name` metadata processed by the `datasets` library, especially within folder-based dataset builders, is thoroughly validated and sanitized. Avoid processing `file_name` values from untrusted sources without strict input validation to prevent directory traversal sequences. This will prevent the embedding of arbitrary local files during `save_to_disk` or `push_to_hub` operations.Source: Red Hat security advisory for GHSA-379c-qx7v-6h59 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat AI Inference Server 3.5 | rhaii/vllm-spyre-rhel9:1791818357 | RHSA-2026:82371 |
| Red Hat OpenShift AI 2.25 | rhoai/odh-pipeline-runtime-pytorch-llmcompressor-cuda-py312-rhel9:1791867208 | RHSA-2026:87410 |
| Red Hat OpenShift AI 3.4 | rhoai/odh-autorag-rhel9:1791557539 | RHSA-2026:84734 |
| Red Hat OpenShift AI 3.5 | rhoai/odh-pipeline-runtime-pytorch-llmcompressor-cuda-py312-rhel9:1791816487 | RHSA-2026:86891 |
Frequently Asked Questions
Is GHSA-379c-qx7v-6h59 in your dependencies?
Find it across PyPI, including transitive dependencies.