From c51a044a2a93042605fc599eaccf69f49fa7bc87 Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Wed, 13 Dec 2017 11:46:40 +0100 Subject: [PATCH] ids.cgi: Add check when altering the ruleset Add a check if the currently processing sid is nummeric, otherwise skip it. Signed-off-by: Stefan Schantl --- html/cgi-bin/ids.cgi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index 2fd4a2f903..63f914701b 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -153,6 +153,9 @@ if ($cgiparams{'RULESET'} eq $Lang::tr{'update'}) { foreach my $rulefile (keys %snortrules) { # Loop through the single rules of the rulefile. foreach my $sid (keys %{$snortrules{$rulefile}}) { + # Skip the current sid if it is not numeric. + next unless ($sid =~ /\d+/ ); + # Check if there exists a key in the cgiparams hash for this sid. if (exists($cgiparams{$sid})) { # Look if the rule is disabled. -- 2.39.5