Skip to content

Commit 13721d1

Browse files
author
azazelm3dj3d
authored
Merge pull request #56 from Synse/fix-backslash-url-re
Fix catastrophic backtracking in BACKSLASH_URL_RE
2 parents 0581dd0 + 1b9906c commit 13721d1

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

iocextract.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -94,25 +94,15 @@
9494
BACKSLASH_URL_RE = re.compile(r"""
9595
\b
9696
(
97-
[\:\/\\\w\[\]\(\)-]+
98-
(?:
99-
\x20?
100-
\\?\.
101-
\x20?
102-
\S*?
103-
)*?
97+
[\.\:\/\\\w\[\]\(\)-]+
10498
(?:
10599
\x20?
106-
\\\.
107-
\x20?
108-
\S*?
109-
)
110-
(?:
100+
\\
111101
\x20?
112-
\\?\.
102+
\.
113103
\x20?
114104
\S*?
115-
)*
105+
)+
116106
)
117107
""" + END_PUNCTUATION + r"""
118108
(?=\s|[^\x00-\x7F]|$)

0 commit comments

Comments
 (0)