Added detector for JFrog Artifactory Reference Tokens#4684
Merged
camgunz merged 5 commits intotrufflesecurity:mainfrom Mar 4, 2026
Merged
Conversation
mustansir14
reviewed
Jan 21, 2026
pkg/detectors/artifactoryreferencetoken/artifactoryreferencetoken.go
Outdated
Show resolved
Hide resolved
mariduv
approved these changes
Feb 4, 2026
kashifkhan0771
approved these changes
Feb 10, 2026
1ec9128 to
9ecd554
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
pkg/detectors/artifactoryreferencetoken/artifactoryreferencetoken.go
Outdated
Show resolved
Hide resolved
bbae3a7 to
04d6285
Compare
…n.SaneHttpClient() just like sibling artifactory detector
peterfraedrich
pushed a commit
to peterfraedrich/trufflehog
that referenced
this pull request
Mar 15, 2026
…y#4684) * added detector for artifactory reference tokens * add artifactory reference token detector to the no cloud endpoints list * address mustansir feedback; remove the invalid host deletion * use detectors.DetectorHttpClientWithNoLocalAddresses instead of common.SaneHttpClient() just like sibling artifactory detector
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.
Summary
Adds a new detector for JFrog Artifactory Reference Tokens. Unlike JWT tokens (which start with
eyJ), reference tokens are base64-encoded strings with a predictable structure:When base64-encoded, this always produces a token starting with
cmVmdGtu.Detection
Regex pattern:
cmVmdGtu(8 chars): base64 encoding of "reftkn"Keyword:
cmVmdGtuVerification
Tokens are verified against the JFrog Access API:
This endpoint returns token metadata if valid. Available since Artifactory 7.53.1.
Response handling:
References
Checklist:
make test-community)?make lintthis requires golangci-lint)?Note
Medium Risk
Introduces a new network-verifying detector and a new protobuf detector type, which can affect verification behavior and compatibility if the API/host handling is incorrect, but changes are otherwise additive and localized.
Overview
Adds a new
ArtifactoryReferenceTokendetector that finds 64-char base64 tokens prefixed withcmVmdGtuand (optionally) verifies them by calling JFrog Access APIGET /access/api/v1/tokens/meagainst discovered/configured*.jfrog.ioendpoints.Verification logic distinguishes valid tokens from invalid subdomains (e.g., 200+HTML treated as bad host), caches unreachable/invalid hosts to avoid repeat lookups, and records verification errors/analysis metadata when appropriate. The detector is wired into the default detector set, adds unit + integration coverage, and updates the engine cloud-endpoint initialization test to allow this new detector to have no cloud endpoint; protobuf enum/types are extended with
DetectorType_ArtifactoryReferenceToken = 1042.Written by Cursor Bugbot for commit 7a5f1db. This will update automatically on new commits. Configure here.