diff --git a/src/assay.cc b/src/assay.cc index bf909ba1..28f75a10 100644 --- a/src/assay.cc +++ b/src/assay.cc @@ -218,6 +218,7 @@ int Assay::processURI(const char *uri, const char *protocol, std::vector key_value = split(t, sep2); store_variable("ARGS:" + key_value[0], key_value[1]); + store_variable("ARGS_GET:" + key_value[0], key_value[1]); this->m_ARGScombinedSize = this->m_ARGScombinedSize + \ key_value[0].length() + key_value[1].length(); this->m_ARGScombinedSizeStr->assign( diff --git a/test/test-cases/regression/variable-ARGS_GET.json b/test/test-cases/regression/variable-ARGS_GET.json new file mode 100644 index 00000000..a0d2d272 --- /dev/null +++ b/test/test-cases/regression/variable-ARGS_GET.json @@ -0,0 +1,85 @@ +[ + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: ARGS_GET (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", + "protocol":"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":"Target value: \"other_value\"" + }, + "rules":[ + "SecRuleEngine On", + "SecDebugLog \/tmp\/modsec_debug.log", + "SecDebugLogLevel 9", + "SecRule ARGS_GET \"@contains test \" \"pass,t:trim\"" + ] + }, + { + "enabled":1, + "version_min":300000, + "title":"Testing Variables :: ARGS_GET (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", + "protocol":"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":"Target value: \"value\"" + }, + "rules":[ + "SecRuleEngine On", + "SecDebugLog \/tmp\/modsec_debug.log", + "SecDebugLogLevel 9", + "SecRule ARGS_GET \"@contains test \" \"pass,t:trim\"" + ] + } +] +