Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions regex-assembly/942220.ra
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
##! Please refer to the documentation at
##! https://coreruleset.org/docs/development/regex_assembly/.

##! Rule 942220: Integer overflow and PHP magic number crash detection
##!
##! Detects known magic numbers used in integer overflow attacks
##! (from skipfish) and the PHP strtod crash (CVE-2011-0753).
##!
##! Ref: https://www.exploringbinary.com/php-hangs-on-numeric-value-2-2250738585072011e-308/

##!+ i

##!^ ^
##!$ $

##! 32-bit unsigned integer max / max+1
4294967295
4294967296

##! 32-bit signed integer max / min / (max+1/min-1)
2147483647
2147483648
-2147483648
-2147483649

##! leading-zero padded integers (skipfish probes)
0000012345
0000023456
-0000023456

##! PHP strtod crash: magic floating-point numbers (CVE-2011-0753)
2.2250738585072007e-308
2.2250738585072011e-308

##! infinity trigger
1e309
9 changes: 7 additions & 2 deletions rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,13 @@ SecRule REQUEST_COOKIES|REQUEST_COOKIES_NAMES|ARGS_NAMES|ARGS|XML:/* "@rx (?i)[\

# Magic number crash in PHP strtod from 2011:
# https://www.exploringbinary.com/php-hangs-on-numeric-value-2-2250738585072011e-308/

SecRule REQUEST_COOKIES|REQUEST_COOKIES_NAMES|ARGS_NAMES|ARGS|XML:/* "@rx ^(?i:-0000023456|4294967295|4294967296|2147483648|2147483647|0000012345|-2147483648|-2147483649|0000023456|2.2250738585072007e-308|2.2250738585072011e-308|1e309)$" \
#
# Regular expression generated from regex-assembly/942220.ra.
# To update the regular expression run the following shell script
# (consult https://coreruleset.org/docs/development/regex_assembly/ for details):
# crs-toolchain regex update 942220
#
SecRule REQUEST_COOKIES|REQUEST_COOKIES_NAMES|ARGS_NAMES|ARGS|XML:/* "@rx (?i)^(?:429496729[56]|2(?:14748364[78]|.22507385850720(?:07|11)e-308)|-(?:214748364[89]|0000023456)|00000(?:12345|23456)|1e309)$" \
"id:942220,\
phase:2,\
block,\
Expand Down
Loading