mirror of https://github.com/mikaku/Monitorix.git
fixed a fail to adequately sanitize request strings of malicious JavaScript #30
This commit is contained in:
parent
a790c283a4
commit
cc9ba672bb
5
Changes
5
Changes
|
@ -33,9 +33,12 @@
|
|||
- Fixed the 'int' graph in order to be compatible with Excito B3 product.
|
||||
(thanks to Patrick Fallberg, patrick AT fallberg.net for pointing this out)
|
||||
- Fixed to correctly sanitize the input string in the built-in HTTP server
|
||||
which led a number of security vulnerabilities. [#30]
|
||||
which led into a number of security vulnerabilities. [#30]
|
||||
- Fixed the lack of minimum definition in some data sources of 'bind' graph.
|
||||
(thanks to Andreas Itzchak Rehberg, izzy AT qumran.org for pointing this out)
|
||||
- Fixed a fail to adequately sanitize request strings of malicious JavaScript.
|
||||
[#30]
|
||||
(thanks to Jacob Amey, jamey AT securityinspection.com for pointing this out)
|
||||
- Small fixes and typos.
|
||||
|
||||
|
||||
|
|
|
@ -153,6 +153,18 @@ sub handle_request {
|
|||
return if fork(); # parent returns
|
||||
|
||||
my $url = $cgi->path_info();
|
||||
my $url_disarmed = $url;
|
||||
|
||||
# this should disarm all XSS and Cookie Injection attempts
|
||||
$url_disarmed =~ s/\&/&/g;
|
||||
$url_disarmed =~ s/\</</g;
|
||||
$url_disarmed =~ s/\>/>/g;
|
||||
$url_disarmed =~ s/\"/"/g;
|
||||
$url_disarmed =~ s/\'/'/g;
|
||||
$url_disarmed =~ s/\(/(/g;
|
||||
$url_disarmed =~ s/\)/)/g;
|
||||
$url_disarmed =~ s/\////g;
|
||||
|
||||
$0 = "monitorix-httpd"; # change process' name
|
||||
|
||||
# check if the IP address is allowed to connect
|
||||
|
@ -166,7 +178,7 @@ sub handle_request {
|
|||
print "<title>403 Forbidden</title>\r\n";
|
||||
print "</head><body>\r\n";
|
||||
print "<h1>Forbidden</h1>\r\n";
|
||||
print "<p>You don't have permission to access $url\r\n";
|
||||
print "<p>You don't have permission to access $url_disarmed\r\n";
|
||||
print "on this server.</p>\r\n";
|
||||
print "<hr>\r\n";
|
||||
print "<address>Monitorix HTTP Server listening at $host Port $port</address>\r\n";
|
||||
|
@ -242,7 +254,7 @@ sub handle_request {
|
|||
print "<title>404 Not Found</title>\r\n";
|
||||
print "</head><body>\r\n";
|
||||
print "<h1>Not Found</h1>\r\n";
|
||||
print "The requested URL $url was not found on this server.<p>\r\n";
|
||||
print "The requested URL $url_disarmed was not found on this server.<p>\r\n";
|
||||
print "<hr>\r\n";
|
||||
print "<address>Monitorix HTTP Server listening at $host Port $port</address>\r\n";
|
||||
print "</body></html>\r\n";
|
||||
|
|
Loading…
Reference in New Issue