Skip to content

Commit

Permalink
[PySecSan] Fix a bug in Regex DoS detector due to typo (#12735)
Browse files Browse the repository at this point in the history
To detect Regex DoS, PySecSan installs pre_hook and post_hook of
re.pattern.findall.
However, due to typo, it installs `hook_pre_exec_re_pattern_findall` as
pre_hook and post_hook.
This leads to failure of detecting Regex DoS bugs.
  • Loading branch information
DaramG authored Nov 25, 2024
1 parent b3ca3a8 commit 2cc80a4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def hook_post_exec_re_compile(retval, pattern, flags=None):
sanlib.sanitizer_log('Inside of post compile hook', sanlib.LOG_DEBUG)
wrapper_object = sanlib.create_object_wrapper(
findall=(hook_pre_exec_re_pattern_findall,
hook_pre_exec_re_pattern_findall))
hook_post_exec_re_pattern_findall))
hooked_object = wrapper_object(retval)
return hooked_object

Expand Down

0 comments on commit 2cc80a4

Please sign in to comment.