Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-commits
Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-commits@g.o
From: "Tobias Scherbaum (dertobi123)" <dertobi123@g.o>
Subject: gentoo-x86 commit in net-analyzer/nagios-core/files: statuswml-bug275288.patch
Date: Wed, 24 Jun 2009 21:27:24 +0000
dertobi123    09/06/24 21:27:24

  Added:                statuswml-bug275288.patch
  Log:
  Revbumps to 2.12-r1, 3.0.6-r2 and also bump to 3.1.2. Includes fix for #275288 (remote code execution in statuswml.cgi).
  (Portage version: 2.2_rc33/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  net-analyzer/nagios-core/files/statuswml-bug275288.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/nagios-core/files/statuswml-bug275288.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/nagios-core/files/statuswml-bug275288.patch?rev=1.1&content-type=text/plain

Index: statuswml-bug275288.patch
===================================================================
--- cgi/statuswml.c	2008/11/30 18:13:11	1.27
+++ cgi/statuswml.c	2009/06/19 04:30:26	1.28
@@ -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){





Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
gentoo-x86 commit in dev-libs/zziplib: ChangeLog zziplib-0.13.55.ebuild
Next by thread:
gentoo-x86 commit in net-analyzer/nagios-core: nagios-core-3.0.6-r2.ebuild ChangeLog nagios-core-3.1.2.ebuild nagios-core-2.12-r1.ebuild nagios-core-3.1.0.ebuild
Previous by date:
gentoo commit in xml/htdocs/proj/en/elections: council-200906-nominees.xml
Next by date:
gentoo-x86 commit in net-analyzer/nagios-core: nagios-core-3.0.6-r2.ebuild ChangeLog nagios-core-3.1.2.ebuild nagios-core-2.12-r1.ebuild nagios-core-3.1.0.ebuild


Updated Jun 26, 2012

Summary: Archive of the gentoo-commits mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.