Skip to content

Find, verify, and analyze leaked credentials

Expand paypal regex (#1599)

Bill Rich1cf419e47828
diff --git a/pkg/detectors/paypaloauth/paypaloauth.go b/pkg/detectors/paypaloauth/paypaloauth.go
index d8a0f5022..e76f76576 100644
--- a/pkg/detectors/paypaloauth/paypaloauth.go
+++ b/pkg/detectors/paypaloauth/paypaloauth.go
@@ -22,8 +22,8 @@ var (
client = common.SaneHttpClient()
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.
- idPat = regexp.MustCompile(`\b([A-Za-z0-9_\.]{7}-[A-Za-z0-9_\.]{72})\b`)
- keyPat = regexp.MustCompile(`\b([A-Za-z0-9_\.]{69}-[A-Za-z0-9_\.]{10})\b`)
+ idPat = regexp.MustCompile(`\b([A-Za-z0-9_\.]{7}-[A-Za-z0-9_\.]{72}|[A-Za-z0-9_\.]{5}-[A-Za-z0-9_\.]{34})\b`)
+ keyPat = regexp.MustCompile(`\b([A-Za-z0-9_\.\-]{40,80})\b`)
)
// Keywords are used for efficiently pre-filtering chunks.
diff --git a/pkg/detectors/paypaloauth/paypaloauth_test.go b/pkg/detectors/paypaloauth/paypaloauth_test.go
index 55ed1e082..f4d5e3204 100644
--- a/pkg/detectors/paypaloauth/paypaloauth_test.go
+++ b/pkg/detectors/paypaloauth/paypaloauth_test.go
@@ -52,6 +52,10 @@ func TestPaypalOauth_FromChunk(t *testing.T) {
DetectorType: detectorspb.DetectorType_PaypalOauth,
Verified: true,
},
+ {
+ DetectorType: detectorspb.DetectorType_PaypalOauth,
+ Verified: false,
+ },
},
wantErr: false,
},
@@ -68,6 +72,10 @@ func TestPaypalOauth_FromChunk(t *testing.T) {
DetectorType: detectorspb.DetectorType_PaypalOauth,
Verified: false,
},
+ {
+ DetectorType: detectorspb.DetectorType_PaypalOauth,
+ Verified: false,
+ },
},
wantErr: false,
},