huggingface: add bucket scanning#5017
Open
julien-c wants to merge 8 commits into
Open
Conversation
XciD
reviewed
Jun 4, 2026
This comment was marked as outdated.
This comment was marked as outdated.
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Reviewed by Cursor Bugbot for commit e4f90eb. Configure here.
shahzadhaider1
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

HF recently shipped storage buckets (Xet-backed object storage)
--bucket <namespace/name>flag, plus--include-buckets/--ignore-buckets/--skip-all-buckets;--org/--userscans pick up buckets automaticallyhandlers.HandleFileTested against a real public bucket (results identical to
trufflehog filesystemon the same file), and a planted canary AWS key comes back as a verified finding with correct bucket metadata.cc @dxa4481
Note
Medium Risk
New external HF API and file download path with token auth; follows existing S3-style patterns but increases network surface and scan scope for org/user runs.
Overview
Adds Hugging Face storage bucket support to the
huggingfacesource so TruffleHog can scan object storage alongside models, datasets, and spaces.CLI and config: New
--bucket,--include-buckets,--ignore-buckets, and--skip-all-bucketsflags (plus proto/engine wiring). Org/user scans enumerate buckets automatically unless skipped. Validation now accepts bucket as a scan target.Scan behavior: Buckets are not git repos. The source lists files via the HF tree API (with Link pagination), downloads each file through a dedicated client (no whole-request timeout on body reads), skips files over 250MB, and chunks content via
handlers.HandleFilewith HuggingFace bucket metadata—similar to the S3 source path.API client:
GetBucket,ListBucketsByAuthor,ListBucketFiles, andDownloadBucketFilewith path-segment escaping for resolve URLs.Docs (
README, man page) and minor comment fixes onScanHuggingfaceare updated.Reviewed by Cursor Bugbot for commit 5a76b32. Bugbot is set up for automated code reviews on this repo. Configure here.