Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
fix: corrected verification endpoint & validation logic for bombbomb (#3462)
Sahil Silarea8585cb83c22
diff --git a/pkg/detectors/bombbomb/bombbomb.go b/pkg/detectors/bombbomb/bombbomb.goindex f8b0600b4..7b188d6bd 100644--- a/pkg/detectors/bombbomb/bombbomb.go+++ b/pkg/detectors/bombbomb/bombbomb.go@@ -21,7 +21,7 @@ var (client = common.SaneHttpClient()// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.- keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"bombbomb"}) + `\b([a-zA-Z0-9-._]{704})\b`)+ keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"bombbomb"}) + common.BuildRegexJWT("0,140", "0,419", "0,171")))// Keywords are used for efficiently pre-filtering chunks.@@ -48,11 +48,12 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}if verify {- req, err := http.NewRequestWithContext(ctx, "GET", "https://api.bombbomb.com/v2/lists/", nil)+ // Reference : https://developer.bombbomb.com/api#operations-Users-UserInfo+ req, err := http.NewRequestWithContext(ctx, "GET", "https://api.bombbomb.com/v2/user/", nil)if err != nil {continue}- req.Header.Add("Authorization", resMatch)+ req.Header.Add("Authorization", "Bearer "+resMatch)res, err := client.Do(req)if err == nil {defer res.Body.Close()