Skip to content

Commit 3e179cd

Browse files
author
Xianjun Zhu
committed
fix: break reserve and delimiter list
1 parent c1b918b commit 3e179cd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

detect_secrets/plugins/basic_auth.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
from .base import RegexBasedDetector
66

77

8-
SPECIAL_URL_CHARACTERS = ':/?#[]@"\''
8+
RESERVED_CHARACTERS = ':/?#[]@'
9+
SUB_DELIMITER_CHARACTERS = '!$&\';' # and anything else we might need
910

1011

1112
class BasicAuthDetector(RegexBasedDetector):
@@ -14,8 +15,8 @@ class BasicAuthDetector(RegexBasedDetector):
1415
blacklist = [
1516
re.compile(
1617
r'://[^{}\s]+:([^{}\s]+)@'.format(
17-
re.escape(SPECIAL_URL_CHARACTERS),
18-
re.escape(SPECIAL_URL_CHARACTERS),
18+
re.escape(RESERVED_CHARACTERS + SUB_DELIMITER_CHARACTERS),
19+
re.escape(RESERVED_CHARACTERS + SUB_DELIMITER_CHARACTERS),
1920
),
2021
),
2122
]

0 commit comments

Comments
 (0)