Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9c1879b

Browse files
fixed multipart form handling issue (#5602) (#5603)
1 parent ae1bd21 commit 9c1879b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/core/target.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ def process(match, repl):
226226
if not (kb.processUserMarks and kb.customInjectionMark in conf.data):
227227
conf.data = getattr(conf.data, UNENCODED_ORIGINAL_VALUE, conf.data)
228228
conf.data = conf.data.replace(kb.customInjectionMark, ASTERISK_MARKER)
229-
conf.data = re.sub(r"(?si)((Content-Disposition[^\n]+?name\s*=\s*[\"']?(?P<name>[^\"'\r\n]+)[\"']?).+?)((%s)--)" % ("\r\n" if "\r\n" in conf.data else '\n'), functools.partial(process, repl=r"\g<1>%s\g<4>" % kb.customInjectionMark), conf.data)
229+
conf.data = re.sub(r"(?si)(Content-Disposition:[^\n]+\s+name=\"(?P<name>[^\"]+)\"(?:[^f|^b]|f(?!ilename=)|b(?!oundary=))*?)((%s)--)" % ("\r\n" if "\r\n" in conf.data else '\n'),
230+
functools.partial(process, repl=r"\g<1>%s\g<3>" % kb.customInjectionMark), conf.data)
230231

231232
if not kb.postHint:
232233
if kb.customInjectionMark in conf.data: # later processed

0 commit comments

Comments
 (0)