8000 fix: move fopen to 933160 to resolve fp with `RootAndLeafOpenCamera.jpg` (933150 PL-1, 933160 PL-1) by EsadCetiner · Pull Request #4016 · coreruleset/coreruleset · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: move fopen to 933160 to resolve fp with RootAndLeafOpenCamera.jpg (933150 PL-1, 933160 PL-1) #4016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 25, 2025
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
1 change: 1 addition & 0 deletions regex-assembly/933160.ra
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ eval
exec
file
filegroup
fopen
glob
imagegif
imagejpeg
Expand Down
2 changes: 1 addition & 1 deletion rules/REQUEST-933-APPLICATION-ATTACK-PHP.conf
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|REQUEST_F
# (consult https://coreruleset.org/docs/development/regex_assembly/ for details):
# crs-toolchain regex update 933160
#
SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|REQUEST_FILENAME|ARGS_NAMES|ARGS|XML:/* "@rx (?i)\b\(?[\"']*(?:assert(?:_options)?|c(?:hr|reate_function)|e(?:val|x(?:ec|p))|file(?:group)?|glob|i(?:mage(?:gif|(?:jpe|pn)g|wbmp|xbm)|s_a)|md5|o(?:pendir|rd)|p(?:assthru|open|rev)|(?:read|tmp)file|un(?:pac|lin)k|s(?:tat|ubstr|ystem))(?:/(?:\*.*\*/|/.*)|#.*|[\s\x0b\"])*[\"']*\)?[\s\x0b]*\([^\)]*\)" \
SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|REQUEST_FILENAME|ARGS_NAMES|ARGS|XML:/* "@rx (?i)\b\(?[\"']*(?:assert(?:_options)?|c(?:hr|reate_function)|e(?:val|x(?:ec|p))|f(?:ile(?:group)?|open)|glob|i(?:mage(?:gif|(?:jpe|pn)g|wbmp|xbm)|s_a)|md5|o(?:pendir|rd)|p(?:assthru|open|rev)|(?:read|tmp)file|un(?:pac|lin)k|s(?:tat|ubstr|ystem))(?:/(?:\*.*\*/|/.*)|#.*|[\s\x0b\"])*[\"']*\)?[\s\x0b]*\([^\)]*\)" \
"id:933160,\
phase:2,\
block,\
Expand Down
1 change: 0 additions & 1 deletion rules/php-function-names-933150.data
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ fclose
file_exists
file_get_contents
finfo_open
fopen
fputs
fsockopen
ftp_connect
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
meta:
author: "lifeforms, azurit"
author: "lifeforms, azurit, Esad Cetiner"
rule_id: 933150
tests:
- test_id: 1
Expand Down Expand Up @@ -552,8 +552,7 @@ tests:
expect_ids: [933150]
- test_id: 33
desc: |
PHP function call with multiple whitespaces.
payload: fopen (blah)
False positive with filename matching `fopen`
stages:
- input:
dest_addr: 127.0.0.1
Expand All @@ -563,8 +562,8 @@ tests:
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
method: GET
port: 80
uri: "/get?foo=fopen%20%20%28blah%29"
uri: "/get?foo=RootAndLeafOpenCamera.jpg"
version: "HTTP/1.1"
output:
log:
expect_ids: [933150]
no_expect_ids: [933150]
Original file line number Diff line number Diff line change
Expand Up @@ -693,3 +693,38 @@ tests:
output:
log:
expect_ids: [933160]
- test_id: 39
desc: |
PHP function call with multiple whitespaces.
payload: fopen (blah)
stages:
- input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: "OWASP CRS test agent"
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
method: GET
port: 80
uri: "/get?foo=fopen%20%20%28blah%29"
version: "HTTP/1.1"
output:
log:
expect_ids: [933160]
- test_id: 40
desc: |
False positive with filename matching `fopen`
stages:
- input:
dest_addr: 127.0.0.1
headers:
Host: localhost
User-Agent: "OWASP CRS test agent"
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
method: GET
port: 80
uri: "/get?foo=RootAndLeafOpenCamera.jpg"
version: "HTTP/1.1"
output:
log:
no_expect_ids: [933160]
0