Hugging Face Transformers unauthorized write of remote code
Start here
A GitHub security advisory states that Hugging Face Transformers 4.49.0 through 5.8.1 has a vulnerability: when calling GenerativePreTrainedModel.load_custom_generate(), remote Python module files are fetched and cached before the user confirms trust_remote_code. Attacker-controlled custom_generate/generate.py code is written to the ~/.cache/huggingface cache directory even if the user rejects the trust prompt.
Generated by AI from reports · Updated 4 days ago
Progress timeline
- GitHub 安全公告SelectedHugging Face Transformers writes custom generated code before trust confirmation
Hugging Face Transformers 4.49.0 through 5.8.1 has a vulnerability where calling GenerativePreTrainedModel.load_custom_generate() fetches and caches remote Python module files before the user confirms trust_remote_code. Attacker-controlled custom_generate/generate.py code is written to the ~/.cache/huggingface/modules directory even if the user rejects the trust prompt. The execution step is still restricted by the trust check, but the file write is irreversible and persists across sessions, potentially causing unauthorized files persisted on disk, as well as cache conflicts leading to attacker code being executed in subsequent trusted model loads.
Related discussion
Attention trend
New sources per day
- Oct 1New1 sources (1 outlets,0 accounts)
- Oct 2New0 sources (0 outlets,0 accounts)
- Oct 3New0 sources (0 outlets,0 accounts)
- Oct 4New0 sources (0 outlets,0 accounts)
- Oct 5New0 sources (0 outlets,0 accounts)
- Oct 6New0 sources (0 outlets,0 accounts)
- Oct 7New0 sources (0 outlets,0 accounts)
- Oct 8New0 sources (0 outlets,0 accounts)
- Oct 9New0 sources (0 outlets,0 accounts)
- Oct 10New0 sources (0 outlets,0 accounts)
- Oct 11New0 sources (0 outlets,0 accounts)
- Oct 12New0 sources (0 outlets,0 accounts)
- Oct 13New0 sources (0 outlets,0 accounts)