Warning: opendir(/var/www/html/web1/serendipity/plugins/serendipity_event_dpsyntaxhighlighter/sh/3.0.83.2/scripts/): failed to open dir: No such file or directory in /var/www/html/web1/serendipity/plugins/serendipity_event_dpsyntaxhighlighter/serendipity_event_dpsyntaxhighlighter.php on line 26

Warning: Invalid argument supplied for foreach() in /var/www/html/web1/serendipity/plugins/serendipity_event_dpsyntaxhighlighter/serendipity_event_dpsyntaxhighlighter.php on line 170
Skip to content

SSCHADV2011-002 - Cross-Site Scripting vulnerability in Nagios

 
Advisory:  Cross-Site Scripting vulnerability in Nagios
Advisory ID:  SSCHADV2011-002
Author:  Stefan Schurtz
Affected Software: Successfully tested on: nagios-3.2.0 / nagios-3.2.3
Vendor URL: http://www.nagios.org
Vendor Status: fixed
CVE-ID: 2011-1523
OSVDB-ID: 71059
 
======================
Vulnerability Description:
======================
 
This is a Cross-Site Scripting vulnerability
 
JavaScript can be included in style sheets by using "expression()" (IE only)
 
==============
Technical Details:
==============
 

 

The function "strip_html_brackets" strip > and < from string but it’s not enough to prevent XSS attacks in "statusmap.cgi&layer="
 
http://site/nagios/cgi-bin/statusmap.cgi?layer=’ style=xss:expression(alert(‘XSS’)) ‘
http://site/nagios/cgi-bin/statusmap.cgi?layer=’ onmouseover="alert(‘XSS’)" ‘
 
======================
cgiutils.c
======================
 
[schnipp]
.
.
/* strip > and < from string */
void strip_html_brackets(char *buffer){ register int x; register int y; register int z; if(buffer==NULL || buffer[0]'x0') return; /* remove all occurances in string */ z=(int)strlen(buffer); for(x=0,y=0;x<z;x++){ if(buffer[x]‘<’ || buffer[x]'>') continue; buffer[y++]=buffer[x]; } buffer[y++]='x0'; return; }
.
.
[schnapp]
 
========================
statusmap.c
========================
[schnipp]
.
.

/* we found the layer argument */
         else if(!strcmp(variables[x],"layer")){
                x++;
                if(variables[x]NULL){
                      error=TRUE;
                      break;
                }
                strip_html_brackets(variables[x]);
                add_layer(variables[x]);
                }
.
.
[schnapp]

========================
Problem in "statusmap.c"
========================
[schnipp]
.
.

/* print layer url info */
void print_layer_url(int get_method){ layer *temp_layer; for(temp_layer=layer_list;temp_layer!=NULL;temp_layer=temp_layer->next){ if(get_method==TRUE) printf("&layer=%s",temp_layer->layer_name); <— no "escape_string" else printf("<input type=‘hidden’ name=‘layer’ value=’%s’>n",escape_string(temp_layer->layer_name));

.
.
[schnapp]
=====
Solution:
=====

if(get_method==TRUE)
          /* printf("&layer=%s",temp_layer->layer_name); */
          printf("&layer=%s",escape_string(temp_layer->layer_name));
 
================
Disclosure Timeline:
================

09-Mar-2011 – informed developers
09-Mar-2011 – post on Nagios Tracker – http://tracker.nagios.org/view.php?id=207
09-Mar-2011 – Release date of this security advisory
10-Mar-2011 – post on BugTraq
10-Mar-2011 – post on Full-disclosure
25-Jul-2001 – fixed in Nagios 3.3.1

====
Credits:
====

Vulnerability found and advisory written by Stefan Schurtz.

=======
References:
=======

http://www.nagios.org
http://www.rul3z.de/advisories/SSCHADV2011-002.txt

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

No comments

Add Comment


To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA 1CAPTCHA 2CAPTCHA 3CAPTCHA 4CAPTCHA 5


Textile-formatting allowed
You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.
Form options
Imprint | Contact | Privacy Statement

Warning: opendir(/var/www/html/web1/serendipity/plugins/serendipity_event_dpsyntaxhighlighter/sh/3.0.83.2/scripts/): failed to open dir: No such file or directory in /var/www/html/web1/serendipity/plugins/serendipity_event_dpsyntaxhighlighter/serendipity_event_dpsyntaxhighlighter.php on line 26

Warning: Invalid argument supplied for foreach() in /var/www/html/web1/serendipity/plugins/serendipity_event_dpsyntaxhighlighter/serendipity_event_dpsyntaxhighlighter.php on line 170