Skip to content

Commit 10c4f9b

Browse files
asterite3Felipe Zimmerle
authored and
Felipe Zimmerle
committed
add a test for macro expansion in @rx
1 parent a760302 commit 10c4f9b

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[
2+
{
3+
"enabled": 1,
4+
"version_min": 209000,
5+
"version_max": -1,
6+
"title": "Macro expansion inside regex does not work",
7+
"url": "https:\/\/github.com\/SpiderLabs\/ModSecurity\/issues\/1528",
8+
"gihub_issue": 1528,
9+
"client": {
10+
"ip": "200.249.12.31",
11+
"port": 2313
12+
},
13+
"server": {
14+
"ip": "200.249.12.31",
15+
"port": 80
16+
},
17+
"request": {
18+
"uri":"/?param=attack",
19+
"headers": "",
20+
"body": "",
21+
"method": "GET",
22+
"http_version": 1.1
23+
},
24+
"response": {
25+
"headers": "",
26+
"body": ""
27+
},
28+
"expected": {
29+
"debug_log": "Rule returned 1",
30+
"error_log": "Matched \"Operator `Rx' with parameter `\\^%{tx\\.bad_value}\\$' against variable `ARGS:param' \\(Value: `attack' "
31+
},
32+
"rules": [
33+
"SecRuleEngine On",
34+
"SecAction \"id:1, nolog, setvar:tx.bad_value=attack\"",
35+
"SecRule ARGS:param \"@rx ^%{tx.bad_value}$\" id:2"
36+
]
37+
}
38+
]

0 commit comments

Comments
 (0)