CWE-79, CAPEC-86, XSS, Cross Site Scripting, d.skimresources.com

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

Report generated by CloudScan Vulnerability Crawler at Fri Feb 25 13:55:53 CST 2011.


The DORK Report

Loading

1. Cross-site scripting (reflected)

2. TRACE method is enabled

3. Private IP addresses disclosed

4. Content type incorrectly stated



1. Cross-site scripting (reflected)  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://d.skimresources.com
Path:   /api/index.php

Issue detail

The value of the callback request parameter is copied into the HTML document as plain text between tags. The payload 25f45<script>alert(1)</script>0bd95c9fd15 was submitted in the callback 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.

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 defenses: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.

Request

GET /api/index.php?callback=skimwordsDataCallback25f45<script>alert(1)</script>0bd95c9fd15&data=%7B%22page%22%3A%22http%3A%2F%2Fwww.bit-tech.net%2Fnews%2F2011%2F01%2F31%2Fmicrosoft-warns-zero-day-windows%2F1%22%7D HTTP/1.1
Host: d.skimresources.com
Proxy-Connection: keep-alive
Referer: http://www.bit-tech.net/news/2011/01/31/microsoft-warns-zero-day-windows/1
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13
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

Response

HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Date: Tue, 15 Feb 2011 21:43:39 GMT
Server: Apache
X-Powered-By: PHP/5.3.2
Content-Length: 718
Connection: keep-alive

skimwordsDataCallback25f45<script>alert(1)</script>0bd95c9fd15({"words":{"1":{"661907":{"id":"661907","word":"windows server 2008","action_type":"1","link":"http:\/\/promotions.newegg.com\/b2b\/Microsoft\/053110Site\/index.html","title":"Shopping link added by Sk
...[SNIP]...

2. TRACE method is enabled  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://d.skimresources.com
Path:   /

Issue description

The TRACE method is designed for diagnostic purposes. If enabled, the web server will respond to requests which use the TRACE method by echoing in its response the exact request which was received.

Although this behaviour is apparently harmless in itself, it can sometimes be leveraged to support attacks against other application users. If an attacker can find a way of causing a user to make a TRACE request, and can retrieve the response to that request, then the attacker will be able to capture any sensitive data which is included in the request by the user's browser, for example session cookies or credentials for platform-level authentication. This may exacerbate the impact of other vulnerabilities, such as cross-site scripting.

Issue remediation

The TRACE method should be disabled on the web server.

Request

TRACE / HTTP/1.0
Host: d.skimresources.com
Cookie: fc92ed3cc7dd514c

Response

HTTP/1.1 200 OK
Content-Type: message/http
Date: Tue, 15 Feb 2011 21:43:21 GMT
Server: Apache
Content-Length: 178
Connection: Close

TRACE / HTTP/1.1
host: d.skimresources.com
Cookie: fc92ed3cc7dd514c
X-Forwarded-For: 173.193.214.243
X-Forwarded-Port: 80
X-Forwarded-Proto: http
Connection: keep-alive


3. Private IP addresses disclosed  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://d.skimresources.com
Path:   /api/index.php

Issue detail

The following RFC 1918 IP address was disclosed in the response:

Issue background

RFC 1918 specifies ranges of IP addresses that are reserved for use in private networks and cannot be routed on the public Internet. Although various methods exist by which an attacker can determine the public IP addresses in use by an organisation, the private addresses used internally cannot usually be determined in the same ways.

Discovering the private addresses used within an organisation can help an attacker in carrying out network-layer attacks aiming to penetrate the organisation's internal infrastructure.

Issue remediation

There is not usually any good reason to disclose the internal IP addresses used within an organisation's infrastructure. If these are being returned in service banners or debug messages, then the relevant services should be configured to mask the private addresses. If they are being used to track back-end servers for load balancing purposes, then the addresses should be rewritten with innocuous identifiers from which an attacker cannot infer any useful information about the infrastructure.

Request

GET /api/index.php?callback=skimwordsDataCallback&data=%7B%22page%22%3A%22http%3A%2F%2Fwww.bit-tech.net%2Fnews%2F2011%2F01%2F31%2Fmicrosoft-warns-zero-day-windows%2F1%22%7D HTTP/1.1
Host: d.skimresources.com
Proxy-Connection: keep-alive
Referer: http://www.bit-tech.net/news/2011/01/31/microsoft-warns-zero-day-windows/1
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13
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

Response

HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Date: Tue, 15 Feb 2011 21:43:20 GMT
Server: Apache
X-Powered-By: PHP/5.3.2
Content-Length: 677
Connection: keep-alive

skimwordsDataCallback({"words":{"1":{"661907":{"id":"661907","word":"windows server 2008","action_type":"1","link":"http:\/\/promotions.newegg.com\/b2b\/Microsoft\/053110Site\/index.html","title":"Sho
...[SNIP]...
ft-warns-zero-day-windows\/1","original_length":65459,"useragent":"Mozilla\/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit\/534.13 (KHTML, like Gecko) Chrome\/9.0.597.98 Safari\/534.13","userip":"10.229.121.239","userlang":"en-US,en;q=0.8"});

4. Content type incorrectly stated  previous

Summary

Severity:   Information
Confidence:   Firm
Host:   http://d.skimresources.com
Path:   /api/index.php

Issue detail

The response contains the following Content-type statement:The response states that it contains HTML. However, it actually appears to contain CSS.

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 /api/index.php?callback=skimwordsDataCallback&data=%7B%22page%22%3A%22http%3A%2F%2Fwww.bit-tech.net%2Fnews%2F2011%2F01%2F31%2Fmicrosoft-warns-zero-day-windows%2F1%22%7D HTTP/1.1
Host: d.skimresources.com
Proxy-Connection: keep-alive
Referer: http://www.bit-tech.net/news/2011/01/31/microsoft-warns-zero-day-windows/1
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13
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

Response

HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Date: Tue, 15 Feb 2011 21:43:20 GMT
Server: Apache
X-Powered-By: PHP/5.3.2
Content-Length: 677
Connection: keep-alive

skimwordsDataCallback({"words":{"1":{"661907":{"id":"661907","word":"windows server 2008","action_type":"1","link":"http:\/\/promotions.newegg.com\/b2b\/Microsoft\/053110Site\/index.html","title":"Sho
...[SNIP]...

Report generated by CloudScan Vulnerability Crawler at Fri Feb 25 13:55:53 CST 2011.