mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 13:56:01 +03:00
Consideres under quote variable while loading the rules
This commit is contained in:
parent
658c9b5dae
commit
210e72aa21
2
CHANGES
2
CHANGES
@ -2,6 +2,8 @@
|
|||||||
v3.0.????? - ?
|
v3.0.????? - ?
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
|
- Consideres under quoted variable while loading the rules.
|
||||||
|
[Felipe Zimmerle/@zimmerle, Victor Hora/@victorhora]
|
||||||
- Store the connection and url parameters in std::string
|
- Store the connection and url parameters in std::string
|
||||||
[Issue: #1571 - @majordaw]
|
[Issue: #1571 - @majordaw]
|
||||||
- Eliminate some reorder and sign warnings
|
- Eliminate some reorder and sign warnings
|
||||||
|
@ -280,4 +280,5 @@ TESTS+=test/test-cases/secrules-language-tests/operators/eq.json
|
|||||||
TESTS+=test/test-cases/regression/offset-variable.json
|
TESTS+=test/test-cases/regression/offset-variable.json
|
||||||
TESTS+=test/test-cases/regression/config-update-target-by-tag.json
|
TESTS+=test/test-cases/regression/config-update-target-by-tag.json
|
||||||
TESTS+=test/test-cases/regression/config-update-target-by-id.json
|
TESTS+=test/test-cases/regression/config-update-target-by-id.json
|
||||||
|
TESTS+=test/test-cases/regression/misc-variable-under-quotes.json
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -677,7 +677,6 @@ EQUALS_MINUS (?i:=\-)
|
|||||||
|
|
||||||
<TRANSACTION_TO_VARIABLE>{
|
<TRANSACTION_TO_VARIABLE>{
|
||||||
[ \t]* { BEGIN(EXPECTING_VARIABLE); }
|
[ \t]* { BEGIN(EXPECTING_VARIABLE); }
|
||||||
[ \t]*\"[ \t]* { BEGIN(EXPECTING_VARIABLE); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<TRANSACTION_FROM_DIRECTIVE_TO_ACTIONS>{
|
<TRANSACTION_FROM_DIRECTIVE_TO_ACTIONS>{
|
||||||
@ -691,6 +690,7 @@ EQUALS_MINUS (?i:=\-)
|
|||||||
<EXPECTING_VARIABLE>{
|
<EXPECTING_VARIABLE>{
|
||||||
[|] { return p::make_PIPE(*driver.loc.back()); }
|
[|] { return p::make_PIPE(*driver.loc.back()); }
|
||||||
[,] { return p::make_PIPE(*driver.loc.back()); }
|
[,] { return p::make_PIPE(*driver.loc.back()); }
|
||||||
|
["] { return p::make_QUOTATION_MARK(yytext, *driver.loc.back()); }
|
||||||
|
|
||||||
[ \t]+ { if (state_variable_from == 0) { BEGIN(EXPECTING_OPERATOR); } else { state_variable_from = 0; BEGIN(INITIAL);} }
|
[ \t]+ { if (state_variable_from == 0) { BEGIN(EXPECTING_OPERATOR); } else { state_variable_from = 0; BEGIN(INITIAL);} }
|
||||||
[ \t]*\" { if (state_variable_from == 0) { BEGIN(EXPECTING_OPERATOR); } else { state_variable_from = 0; BEGIN(INITIAL);} }
|
[ \t]*\" { if (state_variable_from == 0) { BEGIN(EXPECTING_OPERATOR); } else { state_variable_from = 0; BEGIN(INITIAL);} }
|
||||||
@ -833,7 +833,6 @@ EQUALS_MINUS (?i:=\-)
|
|||||||
|
|
||||||
{VAR_EXCLUSION} { return p::make_VAR_EXCLUSION(*driver.loc.back()); }
|
{VAR_EXCLUSION} { return p::make_VAR_EXCLUSION(*driver.loc.back()); }
|
||||||
{VAR_COUNT} { return p::make_VAR_COUNT(*driver.loc.back()); }
|
{VAR_COUNT} { return p::make_VAR_COUNT(*driver.loc.back()); }
|
||||||
["] { return p::make_QUOTATION_MARK(yytext, *driver.loc.back()); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
79
test/test-cases/regression/misc-variable-under-quotes.json
Normal file
79
test/test-cases/regression/misc-variable-under-quotes.json
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"enabled":1,
|
||||||
|
"version_min":300000,
|
||||||
|
"title":"Testing Variables (quoted) :: REQUEST_LINE - contains (1/2)",
|
||||||
|
"client":{
|
||||||
|
"ip":"200.249.12.31",
|
||||||
|
"port":123
|
||||||
|
},
|
||||||
|
"server":{
|
||||||
|
"ip":"200.249.12.31",
|
||||||
|
"port":80
|
||||||
|
},
|
||||||
|
"request":{
|
||||||
|
"headers":{
|
||||||
|
"Host":"localhost",
|
||||||
|
"User-Agent":"curl/7.38.0",
|
||||||
|
"Accept":"*/*"
|
||||||
|
},
|
||||||
|
"uri":"/?key=value&key=other_value",
|
||||||
|
"method":"GET"
|
||||||
|
},
|
||||||
|
"response":{
|
||||||
|
"headers":{
|
||||||
|
"Date":"Mon, 13 Jul 2015 20:02:41 GMT",
|
||||||
|
"Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
|
||||||
|
"Content-Type":"text/html"
|
||||||
|
},
|
||||||
|
"body":[
|
||||||
|
"no need."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"expected":{
|
||||||
|
"debug_log":"t:lowercase:"
|
||||||
|
},
|
||||||
|
"rules":[
|
||||||
|
"SecRule \"REQUEST_LINE\" \"@contains index.php/admin/cms/wysiwyg/directive/\" \"id:1,t:lowercase,ctl:auditLogParts=+E\""
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enabled":1,
|
||||||
|
"version_min":300000,
|
||||||
|
"title":"Testing Variables (quoted) :: REQUEST_LINE - regex (2/2)",
|
||||||
|
"client":{
|
||||||
|
"ip":"200.249.12.31",
|
||||||
|
"port":123
|
||||||
|
},
|
||||||
|
"server":{
|
||||||
|
"ip":"200.249.12.31",
|
||||||
|
"port":80
|
||||||
|
},
|
||||||
|
"request":{
|
||||||
|
"headers":{
|
||||||
|
"Host":"localhost",
|
||||||
|
"User-Agent":"curl/7.38.0",
|
||||||
|
"Accept":"*/*"
|
||||||
|
},
|
||||||
|
"uri":"/?key=value&key=other_value",
|
||||||
|
"method":"GET"
|
||||||
|
},
|
||||||
|
"response":{
|
||||||
|
"headers":{
|
||||||
|
"Date":"Mon, 13 Jul 2015 20:02:41 GMT",
|
||||||
|
"Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
|
||||||
|
"Content-Type":"text/html"
|
||||||
|
},
|
||||||
|
"body":[
|
||||||
|
"no need."
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"expected":{
|
||||||
|
"debug_log":"t:lowercase:"
|
||||||
|
},
|
||||||
|
"rules":[
|
||||||
|
"SecRule \"REQUEST_LINE\" \"index.php/admin/cms/wysiwyg/directive/\" \"id:1,t:lowercase,ctl:auditLogParts=+E\""
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user