<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: JSONP&#8230;you&#039;re joking, right?</title>
	<atom:link href="http://blog.unclehulka.com/2005/12/12/jsonpyoure-joking-right/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.unclehulka.com/2005/12/12/jsonpyoure-joking-right/</link>
	<description>what&#039;s this button do?</description>
	<lastBuildDate>Thu, 24 Jun 2010 07:14:17 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Tim</title>
		<link>http://blog.unclehulka.com/2005/12/12/jsonpyoure-joking-right/#comment-2170</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Wed, 19 May 2010 21:33:53 +0000</pubDate>
		<guid isPermaLink="false">http://unclehulka.com/ryan/blog/?p=246#comment-2170</guid>
		<description>If you&#039;re worried about it, why don&#039;t you just sandbox the provider out of your page?

http://beebole.com/en/blog/general/sandbox-your-cross-domain-jsonp-to-improve-mashup-security/</description>
		<content:encoded><![CDATA[<p>If you&#8217;re worried about it, why don&#8217;t you just sandbox the provider out of your page?</p>
<p><a href="http://beebole.com/en/blog/general/sandbox-your-cross-domain-jsonp-to-improve-mashup-security/" rel="nofollow">http://beebole.com/en/blog/general/sandbox-your-cross-domain-jsonp-to-improve-mashup-security/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Kennedy</title>
		<link>http://blog.unclehulka.com/2005/12/12/jsonpyoure-joking-right/#comment-679</link>
		<dc:creator>Ryan Kennedy</dc:creator>
		<pubDate>Fri, 16 Oct 2009 23:29:57 +0000</pubDate>
		<guid isPermaLink="false">http://unclehulka.com/ryan/blog/?p=246#comment-679</guid>
		<description>neimado, you&#039;re contradicting yourself. First you say &quot;JSONP is no security risk&quot; and then you say &quot;There&#039;s really very little chance that using JSONP in this way will cause the problems you described&quot;. &quot;very little chance&quot; is more than &quot;no chance&quot;.

The point is, you&#039;re putting a TREMENDOUS amount of trust in the service providing the JavaScript. You better hope that trust never proves to be poorly placed.</description>
		<content:encoded><![CDATA[<p>neimado, you&#8217;re contradicting yourself. First you say &#8220;JSONP is no security risk&#8221; and then you say &#8220;There&#8217;s really very little chance that using JSONP in this way will cause the problems you described&#8221;. &#8220;very little chance&#8221; is more than &#8220;no chance&#8221;.</p>
<p>The point is, you&#8217;re putting a TREMENDOUS amount of trust in the service providing the JavaScript. You better hope that trust never proves to be poorly placed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: neimado</title>
		<link>http://blog.unclehulka.com/2005/12/12/jsonpyoure-joking-right/#comment-678</link>
		<dc:creator>neimado</dc:creator>
		<pubDate>Wed, 14 Oct 2009 05:23:04 +0000</pubDate>
		<guid isPermaLink="false">http://unclehulka.com/ryan/blog/?p=246#comment-678</guid>
		<description>JSONP is no security risk.  What you describe in your example is most definitely foolish, irresponsible, and could cause trouble - but it is most certainly not JSONP.  Never insert javascript into your website from any random person. It&#039;s just common sense, but it has nothing to do with JSONP.

JSONP does indeed allow cross-browser communications, but it does not pose a large security risk.

Many popular sites already use it, such as Flickr, Google, Youtube, and others.

Code running on site X requests data from site Y, passing in a callback function name. If site X trusts site Y to deliver clean data using the only the callback function passed in the request, then there isn&#039;t a problem.  If site Y is malicious or the server software gets infected then there could be a problem if it adds malicious code to the response, but it is not as big a risk as you may think.  Sure, if YouTube got hacked in some way, there could be problems on other sites that use the YouTube API as a result, but I trust YouTube&#039;s API is going to work reliably, and I really want access to their data (and so do my users), so the small risk of trusting YouTube&#039;s API is worth the pay-off of having access to their data (while off-loading the work to the client instead of my servers).

There&#039;s really very little chance that using JSONP in this way will cause the problems you described.</description>
		<content:encoded><![CDATA[<p>JSONP is no security risk.  What you describe in your example is most definitely foolish, irresponsible, and could cause trouble &#8211; but it is most certainly not JSONP.  Never insert javascript into your website from any random person. It&#8217;s just common sense, but it has nothing to do with JSONP.</p>
<p>JSONP does indeed allow cross-browser communications, but it does not pose a large security risk.</p>
<p>Many popular sites already use it, such as Flickr, Google, Youtube, and others.</p>
<p>Code running on site X requests data from site Y, passing in a callback function name. If site X trusts site Y to deliver clean data using the only the callback function passed in the request, then there isn&#8217;t a problem.  If site Y is malicious or the server software gets infected then there could be a problem if it adds malicious code to the response, but it is not as big a risk as you may think.  Sure, if YouTube got hacked in some way, there could be problems on other sites that use the YouTube API as a result, but I trust YouTube&#8217;s API is going to work reliably, and I really want access to their data (and so do my users), so the small risk of trusting YouTube&#8217;s API is worth the pay-off of having access to their data (while off-loading the work to the client instead of my servers).</p>
<p>There&#8217;s really very little chance that using JSONP in this way will cause the problems you described.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jaa</title>
		<link>http://blog.unclehulka.com/2005/12/12/jsonpyoure-joking-right/#comment-677</link>
		<dc:creator>jaa</dc:creator>
		<pubDate>Thu, 17 Sep 2009 06:36:33 +0000</pubDate>
		<guid isPermaLink="false">http://unclehulka.com/ryan/blog/?p=246#comment-677</guid>
		<description>I need to provide my site&#039;s application as a &quot;widget&quot; to be hosted on another site. The application is basically a form that collects user data including sensitive fields like SSN. Both mine and the site that will the widget have https:// URLs. Is JSONP (using jQuery) a recommended solution for doing the form submit, if not what are my alternatives?</description>
		<content:encoded><![CDATA[<p>I need to provide my site&#8217;s application as a &#8220;widget&#8221; to be hosted on another site. The application is basically a form that collects user data including sensitive fields like SSN. Both mine and the site that will the widget have https:// URLs. Is JSONP (using jQuery) a recommended solution for doing the form submit, if not what are my alternatives?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Robinson</title>
		<link>http://blog.unclehulka.com/2005/12/12/jsonpyoure-joking-right/#comment-676</link>
		<dc:creator>Tom Robinson</dc:creator>
		<pubDate>Tue, 08 Sep 2009 05:30:28 +0000</pubDate>
		<guid isPermaLink="false">http://unclehulka.com/ryan/blog/?p=246#comment-676</guid>
		<description>JSONP is not as evil as you make it out to be. Yes, you need to be careful, but when used properly with trusted services it&#039;s safe.

Here&#039;s a summary of the security issues with JSONP, as I understand it:

From the consumer&#039;s perspective:
* You must trust the provider to not return malicious JavaScript instead of the expected JSON wrapped in the JSONP callback you specify.
* The same is also true of any third party JavaScript embedded add-ons, such as Google Analytics.
* It&#039;s only similar to XSS attacks in that it allows a 3rd party to execute arbitrary JavaScript in your application, however, you must first choose to trust that 3rd party by making the request in the first place.

From the provider&#039;s perspective:
* You must not assume that even though the clients&#039; cookie(s) are present in the request that the consumer is a webpage under your control. Check the Referer header against a whitelist of authorized URLs, and/or don&#039;t rely on cookie-based authentication.
* Analogous to a CSRF / confused deputy attack.</description>
		<content:encoded><![CDATA[<p>JSONP is not as evil as you make it out to be. Yes, you need to be careful, but when used properly with trusted services it&#8217;s safe.</p>
<p>Here&#8217;s a summary of the security issues with JSONP, as I understand it:</p>
<p>From the consumer&#8217;s perspective:<br />
* You must trust the provider to not return malicious JavaScript instead of the expected JSON wrapped in the JSONP callback you specify.<br />
* The same is also true of any third party JavaScript embedded add-ons, such as Google Analytics.<br />
* It&#8217;s only similar to XSS attacks in that it allows a 3rd party to execute arbitrary JavaScript in your application, however, you must first choose to trust that 3rd party by making the request in the first place.</p>
<p>From the provider&#8217;s perspective:<br />
* You must not assume that even though the clients&#8217; cookie(s) are present in the request that the consumer is a webpage under your control. Check the Referer header against a whitelist of authorized URLs, and/or don&#8217;t rely on cookie-based authentication.<br />
* Analogous to a CSRF / confused deputy attack.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Saikat Chakrabarti</title>
		<link>http://blog.unclehulka.com/2005/12/12/jsonpyoure-joking-right/#comment-675</link>
		<dc:creator>Saikat Chakrabarti</dc:creator>
		<pubDate>Fri, 14 Aug 2009 20:22:33 +0000</pubDate>
		<guid isPermaLink="false">http://unclehulka.com/ryan/blog/?p=246#comment-675</guid>
		<description>The problem is not in whether or not a web site uses JSONP.  I, as a website developer, am responsible for making sure any JSONP code in my site is making requests to servers that I trust.  So, as far as I can tell, as long as I make sure my JSONP code is making requests to trusted servers, using JSONP does not make my website any less secure.

However, regardless of if my site supports JSONP, JSONP support in browsers makes my site more vulnerable to CSRF attacks.  Imagine that Bob is logged in to my site (no JSONP used here).  Bob then clicks on a link from malicious site bad-site.com.  bad-site.com can now, using JSONP, make a request on my server using Bob&#039;s credentials.  Unless my site properly secure my site against a CSRF attack like this (and does not rely on the browser&#039;s same-origin policy), my server will process the malicious request, and bad-site.com can then do whatever it wants with Bob&#039;s data that just got retrieved from my site.  So though I agree with you that this is a security vulnerability in browsers and is a bad thing, I don&#039;t think it is so for the reasons you describe.  When a user visits my site, the user is trusting my site and I think it is reasonable for the user to therefore trust sites that my site trusts.</description>
		<content:encoded><![CDATA[<p>The problem is not in whether or not a web site uses JSONP.  I, as a website developer, am responsible for making sure any JSONP code in my site is making requests to servers that I trust.  So, as far as I can tell, as long as I make sure my JSONP code is making requests to trusted servers, using JSONP does not make my website any less secure.</p>
<p>However, regardless of if my site supports JSONP, JSONP support in browsers makes my site more vulnerable to CSRF attacks.  Imagine that Bob is logged in to my site (no JSONP used here).  Bob then clicks on a link from malicious site bad-site.com.  bad-site.com can now, using JSONP, make a request on my server using Bob&#8217;s credentials.  Unless my site properly secure my site against a CSRF attack like this (and does not rely on the browser&#8217;s same-origin policy), my server will process the malicious request, and bad-site.com can then do whatever it wants with Bob&#8217;s data that just got retrieved from my site.  So though I agree with you that this is a security vulnerability in browsers and is a bad thing, I don&#8217;t think it is so for the reasons you describe.  When a user visits my site, the user is trusting my site and I think it is reasonable for the user to therefore trust sites that my site trusts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dallas Gutauckis</title>
		<link>http://blog.unclehulka.com/2005/12/12/jsonpyoure-joking-right/#comment-674</link>
		<dc:creator>Dallas Gutauckis</dc:creator>
		<pubDate>Wed, 12 Aug 2009 17:48:48 +0000</pubDate>
		<guid isPermaLink="false">http://unclehulka.com/ryan/blog/?p=246#comment-674</guid>
		<description>I think the main concern here is the exposing of data as JSONP. A developer should certainly be careful in their implementation if the data contained within the output is sensitive data. If your goal is to expose data between subdomains of your own site (myservice1.mydomain.com needs to request data via JSONP from myservice2.mydomain.com) one should implement a security check around the function call:

var a=window.location.host;var d=&quot;.mydomain.com&quot;;if(a.length-d.length===a.lastIndexOf(d)){callback(...)}</description>
		<content:encoded><![CDATA[<p>I think the main concern here is the exposing of data as JSONP. A developer should certainly be careful in their implementation if the data contained within the output is sensitive data. If your goal is to expose data between subdomains of your own site (myservice1.mydomain.com needs to request data via JSONP from myservice2.mydomain.com) one should implement a security check around the function call:</p>
<p>var a=window.location.host;var d=&#8221;.mydomain.com&#8221;;if(a.length-d.length===a.lastIndexOf(d)){callback(&#8230;)}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David-Sarah Hopwood</title>
		<link>http://blog.unclehulka.com/2005/12/12/jsonpyoure-joking-right/#comment-673</link>
		<dc:creator>David-Sarah Hopwood</dc:creator>
		<pubDate>Mon, 06 Apr 2009 18:12:56 +0000</pubDate>
		<guid isPermaLink="false">http://unclehulka.com/ryan/blog/?p=246#comment-673</guid>
		<description>I agree that this is a security flaw. However, it was wildly optimistic to expect that browser implementors would fix it (and indeed they haven&#039;t, over three years later). The implementors, especially Mozilla.org and Microsoft, have a habit of favouring &quot;compatibility&quot; over security, i.e. deliberately not fixing JavaScript security flaws that they think anyone is relying on.</description>
		<content:encoded><![CDATA[<p>I agree that this is a security flaw. However, it was wildly optimistic to expect that browser implementors would fix it (and indeed they haven&#8217;t, over three years later). The implementors, especially Mozilla.org and Microsoft, have a habit of favouring &#8220;compatibility&#8221; over security, i.e. deliberately not fixing JavaScript security flaws that they think anyone is relying on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Kennedy</title>
		<link>http://blog.unclehulka.com/2005/12/12/jsonpyoure-joking-right/#comment-672</link>
		<dc:creator>Ryan Kennedy</dc:creator>
		<pubDate>Fri, 27 Mar 2009 18:11:40 +0000</pubDate>
		<guid isPermaLink="false">http://unclehulka.com/ryan/blog/?p=246#comment-672</guid>
		<description>Gregers, you&#039;re missing my point. You&#039;re enabling third parties to run arbitrary JavaScript within the scope of your own domain. I understand that large companies utilize this to their advantage for legitimate purposes, however you cannot deny that you are putting a tremendous amount of trust in those companies since you&#039;re giving them carte blanche to do whatever they want with your page and any information they can access from it.

I&#039;m happy to see the new work being done in future browsers to provide us with a means of implementing the tasks currently offloaded to JSONP in a more secure manner. In the meantime, we just have to hope that JSONP service providers don&#039;t end up adding malicious payloads to their responses.</description>
		<content:encoded><![CDATA[<p>Gregers, you&#8217;re missing my point. You&#8217;re enabling third parties to run arbitrary JavaScript within the scope of your own domain. I understand that large companies utilize this to their advantage for legitimate purposes, however you cannot deny that you are putting a tremendous amount of trust in those companies since you&#8217;re giving them carte blanche to do whatever they want with your page and any information they can access from it.</p>
<p>I&#8217;m happy to see the new work being done in future browsers to provide us with a means of implementing the tasks currently offloaded to JSONP in a more secure manner. In the meantime, we just have to hope that JSONP service providers don&#8217;t end up adding malicious payloads to their responses.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gregers Gram Rygg</title>
		<link>http://blog.unclehulka.com/2005/12/12/jsonpyoure-joking-right/#comment-671</link>
		<dc:creator>Gregers Gram Rygg</dc:creator>
		<pubDate>Thu, 26 Mar 2009 12:05:33 +0000</pubDate>
		<guid isPermaLink="false">http://unclehulka.com/ryan/blog/?p=246#comment-671</guid>
		<description>Sorry that I&#039;m correcting a very old blog post of yours, but it&#039;s been referenced from stackoverflow.com.

You seem to be confused with XSS, which is another issue, not a JSONP issue. You always have to secure your user input for scripts. JSONP only allows a script to use a callback to receive data from a service. So what you have to watch out for is other sites trying to get sensitive data from your services. Also called Cross Site Request Forgery:
http://www.squarefree.com/securitytips/web-developers.html#CSRF

And you&#039;re wrong about will cease to work. It&#039;s used by several large companies, like Google. W3C is working on drafts for Cross Domain Requests, and Microsoft have already implemented support in IE8:
http://dev.w3.org/2006/webapi/XMLHttpRequest-2/
http://blogs.msdn.com/ie/archive/2008/06/23/securing-cross-site-xmlhttprequest.aspx</description>
		<content:encoded><![CDATA[<p>Sorry that I&#8217;m correcting a very old blog post of yours, but it&#8217;s been referenced from stackoverflow.com.</p>
<p>You seem to be confused with XSS, which is another issue, not a JSONP issue. You always have to secure your user input for scripts. JSONP only allows a script to use a callback to receive data from a service. So what you have to watch out for is other sites trying to get sensitive data from your services. Also called Cross Site Request Forgery:<br />
<a href="http://www.squarefree.com/securitytips/web-developers.html#CSRF" rel="nofollow">http://www.squarefree.com/securitytips/web-developers.html#CSRF</a></p>
<p>And you&#8217;re wrong about will cease to work. It&#8217;s used by several large companies, like Google. W3C is working on drafts for Cross Domain Requests, and Microsoft have already implemented support in IE8:<br />
<a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/" rel="nofollow">http://dev.w3.org/2006/webapi/XMLHttpRequest-2/</a><br />
<a href="http://blogs.msdn.com/ie/archive/2008/06/23/securing-cross-site-xmlhttprequest.aspx" rel="nofollow">http://blogs.msdn.com/ie/archive/2008/06/23/securing-cross-site-xmlhttprequest.aspx</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
