Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Victim must actively load a malicious model (UI:R); no attacker privileges needed (PR:N); confidentiality limited to files readable by the process (C:L); no integrity or availability impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
Lifecycle Timeline
3DescriptionCVE.org
Diffusers through 0.39.0, fixed in commit cee298c, contains a path traversal vulnerability in the _get_checkpoint_shard_files function that allows attackers to read arbitrary files by supplying malicious weight_map values in model index JSON. Attackers can use ../ sequences or absolute paths in weight_map entries to escape the model directory and read safetensors files outside the intended location during model loading.
AnalysisAI
Path traversal in HuggingFace Diffusers through 0.39.0 enables arbitrary file reads when a user or pipeline loads a maliciously crafted model. The _get_checkpoint_shard_files function in hub_utils.py blindly resolves weight_map shard filenames from model index JSON without validating for path separators or absolute paths, allowing an attacker who controls a model repository to escape the model directory and read any file accessible to the Diffusers process. No active exploitation confirmed (not in CISA KEV), but a public POC issue exists on GitHub and the attack surface includes the widely-used HuggingFace Hub ecosystem.
Technical ContextAI
The vulnerable function _get_checkpoint_shard_files (src/diffusers/utils/hub_utils.py) reads a shard index JSON file (e.g., diffusion_pytorch_model.safetensors.index.json) and iterates over weight_map entries that map model parameter names to shard filenames within the model directory. Because the filenames were not sanitized, an attacker-controlled index could supply values such as ../secret/SECRET.safetensors or /home/user/.ssh/id_rsa.safetensors, causing the library to resolve and read paths outside the intended model directory. Root cause is CWE-22 (Improper Limitation of a Pathname to a Restricted Directory - Path Traversal). The fix in commit cee298c adds a single validation: os.path.basename(shard_filename) != shard_filename raises a ValueError for any filename containing a path separator or parent-directory reference. Tests in PR #14182 confirm rejection of ../, absolute paths, and subdirectory components. Affected CPE: cpe:2.3:a:huggingface:diffusers:*:*:*:*:*:*:*:*.
RemediationAI
Upgrade HuggingFace Diffusers to any release incorporating commit cee298c - verify via pip show diffusers and cross-reference the package changelog, as the exact first patched release version is not confirmed from available data (upstream fix is in PR #14182 at https://github.com/huggingface/diffusers/pull/14182). As an immediate compensating control pending upgrade, audit any model index JSON files (*.safetensors.index.json) before loading - specifically grep weight_map values for ../, /, or absolute path strings and reject models containing them; this adds a manual review step but has no functional side effects. Running the Diffusers process under a least-privilege OS user or within a container with a minimal read-only filesystem mount (restricting access outside the model cache directory) limits exfiltration scope if exploitation occurs, at the cost of added operational complexity. Avoid loading models from untrusted or unreviewed sources on HuggingFace Hub until the library is patched.
More in Hugging Face
View allThe huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data
Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS
Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the huggingface/transformers repository,
Path traversal in Hugging Face Datasets up to 5.0.0 allows attackers to read arbitrary local files when a victim process
Path traversal in Hugging Face Accelerate through 1.14.0 exposes two distinct attack outcomes when a user loads a crafte
Server-side request forgery in HuggingFace text-generation-inference through version 3.3.7 enables unauthenticated remot
A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, spe
Remote code execution in Hugging Face Transformers 5.2.0 allows a malicious model repository to bypass the user's explic
Unauthenticated remote code execution in HuggingFace LeRobot (versions 0 through 0.5.1) stems from pickle.loads() being
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, sp
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the Hugging Face Transformers library, sp
Same weakness CWE-22 – Path Traversal
View allSame technique Path Traversal
View allVendor StatusVendor
Share
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-48343
GHSA-9576-hw58-7552