HuggingFace token detector not working properly (wrong number of characters) #6823
Closed
2 tasks done
Labels
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
kind/bug
Categorizes issue or PR as related to a bug.
scan/secret
Issues relating to secret scanning
Discussed in #6784
Originally posted by asankov May 27, 2024
Description
I am playing around with the secret detector in https://github.com/aquasecurity/trivy/blob/main/pkg/fanal/secret/ and I notice that the detector is not able to detect Hugging Face tokens.
Looking at the HF Regex it expected 39 symbols after
hf_
. However, my HF token has only 34 symbols.Example HF token:
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
(already revoked)Desired Behavior
Detect a HF token.
Actual Behavior
Not detecting a HF token.
Reproduction Steps
1. Create a Hugging Face account at https://huggingface.co/ 2. Generate an API token at https://huggingface.co/settings/tokens 3. Provide that token as input to the `secret.Scanner` 4. Assert that it returns no findings
Target
Filesystem
Scanner
Secret
Output Format
None
Mode
Standalone
Debug Output
Operating System
macOS
Version
Checklist
trivy image --reset
The text was updated successfully, but these errors were encountered: