LS-AI-004: HuggingFace Token¶
| Severity | HIGH |
| Blast radius | Private model/dataset access |
| Rotate at | https://huggingface.co/settings/tokens |
--verify |
GET https://huggingface.co/api/whoami-v2 |
If this leaks¶
Allows downloading private models and datasets, and if the token has write access, pushing or deleting models under the user's account.
What to do¶
- Rotate or revoke the credential at https://huggingface.co/settings/tokens.
- Check the provider's audit logs for use you don't recognise.
- Remove it from git history (
leakscan purge --help) and load it from an environment variable or secret manager instead.
Pattern¶
\bhf_[a-zA-Z0-9]{34,}\b
Suppress¶
On one line: # leakscan:ignore LS-AI-004. For the whole project:
disable_rules: [LS-AI-004]