GPU VulnDB

Database/AI/ML frameworks & serving

Hugging Face Transformers: path traversal in save_pretrained() writes files outside the save directory

CVE-2026-9856AI/ML frameworks & servingcurated

Impact

Keys of the chat_template dictionary in tokenizer_config.json are used directly as filenames when a tokenizer or processor is re-saved, with no validation. A model repository on the Hub can therefore carry a crafted config whose keys traverse out of the intended output directory, so that any pipeline which downloads that repo and calls save_pretrained() writes attacker-controlled content to an attacker-chosen path with the privileges of the job. On a GPU fleet this is the normal shape of a fine-tuning or model-conversion job: pull a checkpoint from the Hub, re-save the tokenizer into a shared cache or model registry. Where those jobs run as root in a container, or write into an NFS/object-backed model store shared with other tenants, the write lands somewhere later code executes from - a startup script, a conda site-packages file, a served model directory. Processors inheriting from ProcessorMixin are affected broadly, including Idefics, Florence, Gemma, Phi and Qwen-VL.

Who can reach it

No access to the cluster is needed. The attacker publishes a model repository; a user or an automated pipeline on the fleet must download it and call save_pretrained() on the tokenizer or processor (CVSS records this as user interaction required). Exposure is proportional to how freely jobs pull from untrusted Hub namespaces.

What to do

Upgrade transformers past the fix in commit eaaaf84 and rebuild the training/serving images that pin it, then restart the jobs and inference processes using them; the record names affected versions as <= 5.8.0.dev0 but does not state a released fixed version, so check the project release notes before pinning. Until images are rebuilt, restrict which Hub namespaces jobs may pull from, and avoid running save_pretrained() as root or into shared model stores. No node reboot or firmware work is involved.

References

Related entries

All AI/ML frameworks & serving entries

This entry is curated: imported from vendor advisories with machine assistance, not yet individually verified. Confirm against your vendor's advisory before acting, and report anything wrong.