aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt
diff options
context:
space:
mode:
authorwxs <wxs@FreeBSD.org>2009-07-14 20:54:20 +0800
committerwxs <wxs@FreeBSD.org>2009-07-14 20:54:20 +0800
commita4b9aeb7f850fd6c143c492b82e3530a5c90d545 (patch)
tree4094309f0f5091a501e45e8b9f0b2852df0f3acb /net-mgmt
parentda612804cada44e4ee2b42f3a37c09553cca4800 (diff)
downloadfreebsd-ports-gnome-a4b9aeb7f850fd6c143c492b82e3530a5c90d545.tar.gz
freebsd-ports-gnome-a4b9aeb7f850fd6c143c492b82e3530a5c90d545.tar.zst
freebsd-ports-gnome-a4b9aeb7f850fd6c143c492b82e3530a5c90d545.zip
- Address command injection vulnerability
PR: ports/136187 Submitted by: Jarrod Sayers <jarrod@netleader.com.au> Security: 3ebd4cb5-657f-11de-883a-00e0815b8da8
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/nagios/Makefile2
-rw-r--r--net-mgmt/nagios/files/patch-cgi-statuswml.c51
2 files changed, 52 insertions, 1 deletions
diff --git a/net-mgmt/nagios/Makefile b/net-mgmt/nagios/Makefile
index f091c61ec841..bf38e0590503 100644
--- a/net-mgmt/nagios/Makefile
+++ b/net-mgmt/nagios/Makefile
@@ -7,7 +7,7 @@
PORTNAME= nagios
PORTVERSION= 3.0.6
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= net-mgmt
MASTER_SITES= SF
diff --git a/net-mgmt/nagios/files/patch-cgi-statuswml.c b/net-mgmt/nagios/files/patch-cgi-statuswml.c
new file mode 100644
index 000000000000..2c562217bf03
--- /dev/null
+++ b/net-mgmt/nagios/files/patch-cgi-statuswml.c
@@ -0,0 +1,51 @@
+--- cgi/statuswml.c.orig 2008-12-01 04:43:11.000000000 +1030
++++ cgi/statuswml.c 2009-07-09 18:35:02.000000000 +0930
+@@ -67,6 +67,8 @@
+ void document_header(void);
+ void document_footer(void);
+ int process_cgivars(void);
++int validate_arguments(void);
++int is_valid_hostip(char *hostip);
+
+ int display_type=DISPLAY_INDEX;
+ int hostgroup_style=DISPLAY_HOSTGROUP_SUMMARY;
+@@ -108,6 +110,13 @@
+
+ document_header();
+
++ /* validate arguments in URL */
++ result=validate_arguments();
++ if(result==ERROR){
++ document_footer();
++ return ERROR;
++ }
++
+ /* read the CGI configuration file */
+ result=read_cgi_config_file(get_cgi_config_location());
+ if(result==ERROR){
+@@ -334,7 +343,25 @@
+ return error;
+ }
+
++int validate_arguments(void){
++ int result=OK;
++ if((strcmp(ping_address,"")) && !is_valid_hostip(ping_address)) {
++ printf("<p>Invalid host name/ip</p>\n");
++ result=ERROR;
++ }
++ if(strcmp(traceroute_address,"") && !is_valid_hostip(traceroute_address)){
++ printf("<p>Invalid host name/ip</p>\n");
++ result=ERROR;
++ }
++ return result;
++ }
+
++int is_valid_hostip(char *hostip) {
++ char *valid_domain_chars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-";
++ if(strcmp(hostip,"") && strlen(hostip)==strspn(hostip,valid_domain_chars) && hostip[0] != '-' && hostip[strlen(hostip)-1] != '-')
++ return TRUE;
++ return FALSE;
++ }
+
+ /* main intro screen */
+ void display_index(void){