Skip to content

Commit 508a2b5

Browse files
author
Felipe Zimmerle
committed
Adds sanity check on SecRemoteRules directive input
1 parent 49b7ea9 commit 508a2b5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/parser/seclang-scanner.ll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,10 @@ EQUALS_MINUS (?i:=\-)
954954
std::string url;
955955
956956
std::vector<std::string> conf = modsecurity::utils::string::split(yytext, ' ');
957+
if (conf.size() < 2) {
958+
driver.error (*driver.loc.back(), "", "SecRemoteRules demands a key and a URI");
959+
throw p::syntax_error(*driver.loc.back(), "");
960+
}
957961
key = conf[1];
958962
url = conf[2];
959963
c.setKey(key);

0 commit comments

Comments
 (0)