Skip to content

Commit a8585cb

Browse files
fix: corrected verification endpoint & validation logic for bombbomb (#3462)
* fix: corrected verification endpoint for bombbomb * fix: corrected verification endpoint and validation logic for bombbomb * Remove debug binary file from tracking * feat: added common jwt pattern Signed-off-by: Sahil Silare <[email protected]> * fix: fixed the regex to include common prefix Signed-off-by: Sahil Silare <[email protected]> * fix: added common prefix to JWT Pattern Signed-off-by: Sahil Silare <[email protected]> * chore: changed the regex to call the function `BuildRegex` Signed-off-by: Sahil Silare <[email protected]> --------- Signed-off-by: Sahil Silare <[email protected]> Co-authored-by: Kashif Khan <[email protected]>
1 parent f105aa9 commit a8585cb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/detectors/bombbomb/bombbomb.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var (
2121
client = common.SaneHttpClient()
2222

2323
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.
24-
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"bombbomb"}) + `\b([a-zA-Z0-9-._]{704})\b`)
24+
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"bombbomb"}) + common.BuildRegexJWT("0,140", "0,419", "0,171"))
2525
)
2626

2727
// Keywords are used for efficiently pre-filtering chunks.
@@ -48,11 +48,12 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
4848
}
4949

5050
if verify {
51-
req, err := http.NewRequestWithContext(ctx, "GET", "https://api.bombbomb.com/v2/lists/", nil)
51+
// Reference : https://developer.bombbomb.com/api#operations-Users-UserInfo
52+
req, err := http.NewRequestWithContext(ctx, "GET", "https://api.bombbomb.com/v2/user/", nil)
5253
if err != nil {
5354
continue
5455
}
55-
req.Header.Add("Authorization", resMatch)
56+
req.Header.Add("Authorization", "Bearer "+resMatch)
5657
res, err := client.Do(req)
5758
if err == nil {
5859
defer res.Body.Close()

0 commit comments

Comments
 (0)