Skip to content
Open
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
2 changes: 2 additions & 0 deletions plugins/phpmyadmin-rule-exclusions-before.conf
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ SecRule REQUEST_FILENAME "@endsWith /sql.php" \
ctl:ruleRemoveTargetById=942510;ARGS:goto,\
ctl:ruleRemoveTargetByTag=attack-sqli;ARGS:sql_query,\
ctl:ruleRemoveTargetById=932115;ARGS:sql_query,\
ctl:ruleRemoveTargetById=932235;ARGS:sql_query,\
ctl:ruleRemoveTargetById=932370;ARGS:sql_query,\
ctl:ruleRemoveTargetById=932380;ARGS:sql_query,\
ctl:ruleRemoveTargetById=933120;ARGS:sql_query"
Expand Down Expand Up @@ -686,6 +687,7 @@ SecRule ARGS:route "@streq /sql" \
ctl:ruleRemoveTargetById=942510;ARGS:goto,\
ctl:ruleRemoveTargetByTag=attack-sqli;ARGS:sql_query,\
ctl:ruleRemoveTargetById=932115;ARGS:sql_query,\
ctl:ruleRemoveTargetById=932235;ARGS:sql_query,\
ctl:ruleRemoveTargetById=932370;ARGS:sql_query,\
ctl:ruleRemoveTargetById=932380;ARGS:sql_query,\
ctl:ruleRemoveTargetById=933120;ARGS:sql_query"
Expand Down
24 changes: 24 additions & 0 deletions tests/regression/phpmyadmin-plugin/9513240.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,27 @@
# output:
# log:
# no_expect_ids: [932380]
# - test_id: 2
# desc: FP with sql_query parameter and JOIN keyword
# 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
# Cookie: phpMyAdmin=1
# port: 80
# method: POST
# version: HTTP/1.1
# uri: /post/sql.php
# data: |-
# sql_query=SELECT link_rewrite, COUNT(*) c
# FROM ps_product_lang pl
# JOIN ps_product_shop ps ON ps.id_product = pl.id_product AND ps.id_shop = 2
# WHERE pl.id_lang = 8
# GROUP BY link_rewrite
# HAVING c > 1;
# output:
# log:
# no_expect_ids: [932235]
24 changes: 24 additions & 0 deletions tests/regression/phpmyadmin-plugin/9513650.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,27 @@ tests:
output:
log:
no_expect_ids: [932380]
- test_id: 2
desc: FP with sql_query parameter and JOIN keyword
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
Cookie: phpMyAdmin=1
port: 80
method: POST
version: HTTP/1.1
uri: /post/index.php?route=/sql
data: |-
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually what the request body looks like? This test isn't testing false positives against ARGS:sql_query

sql_query=SELECT link_rewrite, COUNT(*) c
FROM ps_product_lang pl
JOIN ps_product_shop ps ON ps.id_product = pl.id_product AND ps.id_shop = 2
WHERE pl.id_lang = 8
GROUP BY link_rewrite
HAVING c > 1;
output:
log:
no_expect_ids: [932235]