Skip to content

Find, verify, and analyze leaked credentials

fixed helpscout detector regex and verifier (#2056)

Ankush Goelab896890b407
diff --git a/pkg/detectors/helpscout/helpscout.go b/pkg/detectors/helpscout/helpscout.go
index becc8caa9..ed139de33 100644
--- a/pkg/detectors/helpscout/helpscout.go
+++ b/pkg/detectors/helpscout/helpscout.go
@@ -2,7 +2,6 @@ package helpscout
import (
"context"
- "fmt"
"net/http"
"regexp"
"strings"
@@ -21,7 +20,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{"helpscout"}) + `\b([A-Za-z0-9]{56})\b`)
+ keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"helpscout"}) + `\b([a-z0-9]{40})\b`)
)
// Keywords are used for efficiently pre-filtering chunks.
@@ -52,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if err != nil {
continue
}
- req.Header.Add("Authorization", fmt.Sprintf("Basic %s", resMatch))
+ req.SetBasicAuth(resMatch, "X")
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()