SSCHADV2011-003 - Cross-Site Scripting vulnerability in Icinga
Advisory: | Cross-Site Scripting vulnerability in Icinga |
Advisory ID: | SSCHADV2011-003 |
Author: | Stefan Schurtz |
Affected Software: | Successfully tested on: icinga-1.3.0 / icinga-1.2.1 |
Vendor URL: | http://www.icinga.org |
Vendor Status: |
statusmap.cgi: fixed XSS vulnerability #1281
Target version set to 1.4
|
OSVDB-ID: | 71052 |
======================
Vulnerability Description:
======================
This is a Cross-Site Scripting vulnerability
JavaScript can be included in style sheets by using "expression()" (IE only)
==============
Technical Details:
==============
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/icinga/cgi-bin/statusmap.cgi?layer=’ style=xss:expression(alert(‘XSS’)) ‘
http://site/icinga/cgi-bin/statusmap.cgi?layer=’ onmouseover="alert(‘XSS’)" ‘
======================
cgiutils.c
======================
http://site/icinga/cgi-bin/statusmap.cgi?layer=’ style=xss:expression(alert(‘XSS’)) ‘
http://site/icinga/cgi-bin/statusmap.cgi?layer=’ onmouseover="alert(‘XSS’)" ‘
======================
cgiutils.c
======================
/* 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;
}
========================
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;
}
========================
statusmap.c
========================
========================
/* 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]);
}
else if(!strcmp(variables[x],"layer")){
x++;
if(variables[x]NULL){
error=TRUE;
break;
}
strip_html_brackets(variables[x]);
add_layer(variables[x]);
}
======================
Problem in "statusmap.c"
======================
Problem in "statusmap.c"
======================
/* 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_methodTRUE)
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));
}
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_methodTRUE)
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));
}
=====
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 dev.icinga.org – https://dev.icinga.org/issues/1281
11-Mar-2011 – statusmap.cgi: fixed XSS vulnerability #1281 # Target version set to 1.4
====
Credits:
====
Vulnerability found and advisory written by Stefan Schurtz.
=======
References:
=======
================
09-Mar-2011 – informed developers
09-Mar-2011 – post on dev.icinga.org – https://dev.icinga.org/issues/1281
11-Mar-2011 – statusmap.cgi: fixed XSS vulnerability #1281 # Target version set to 1.4
====
Credits:
====
Vulnerability found and advisory written by Stefan Schurtz.
=======
References:
=======
Comments
Display comments as Linear | Threaded