<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: JSON and Browser Security</title>
	<link>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/</link>
	<description>News and Artilces about Designing and Developing with Yahoo! Libraries.</description>
	<pubDate>Mon, 12 May 2008 09:39:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: Douglas Crockford</title>
		<link>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-316944</link>
		<dc:creator>Douglas Crockford</dc:creator>
		<pubDate>Wed, 05 Mar 2008 02:11:41 +0000</pubDate>
		<guid>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-316944</guid>
		<description>Closures are safe, but there is not a secure way to get the key into the closure. So no good.</description>
		<content:encoded><![CDATA[<p>Closures are safe, but there is not a secure way to get the key into the closure. So no good.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chas</title>
		<link>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-316791</link>
		<dc:creator>Chas</dc:creator>
		<pubDate>Tue, 04 Mar 2008 22:31:16 +0000</pubDate>
		<guid>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-316791</guid>
		<description>So it would do no good to store the key in a closure?</description>
		<content:encoded><![CDATA[<p>So it would do no good to store the key in a closure?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Messages in a bottle &#187; Blog Archive &#187; Gravity never sleeps (notations that use eval)</title>
		<link>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-268214</link>
		<dc:creator>Messages in a bottle &#187; Blog Archive &#187; Gravity never sleeps (notations that use eval)</dc:creator>
		<pubDate>Sat, 29 Dec 2007 02:40:15 +0000</pubDate>
		<guid>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-268214</guid>
		<description>[...] it, so that the developer doesn&#8217;t have to use eval. And last April, Doug Crockford argued in a piece on JSON and browser security that JSON is security neutral (as near as I can make out, because the security problem is in the [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] it, so that the developer doesn&#8217;t have to use eval. And last April, Doug Crockford argued in a piece on JSON and browser security that JSON is security neutral (as near as I can make out, because the security problem is in the [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Hoang Le</title>
		<link>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-173455</link>
		<dc:creator>Kevin Hoang Le</dc:creator>
		<pubDate>Fri, 17 Aug 2007 17:25:41 +0000</pubDate>
		<guid>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-173455</guid>
		<description>Douglas,
Great article.  Everything is well explained, except I am still confused by the section "Don't Send Data to Strangers" and your previous answer to TC.

Why am I confused? 

1. So external scripts are dangerous, we hear that.  But even if I do not include any external script, this still remains as a valid concern, right?  Because someone evil do NOT really need me to include their evil scripts in order to steal information, they can just make the requests directly to my server?  Without any form of authentication, my server cannot tell whether the request come from my page or anywhere else, and it's bad if my server blindly return the JSON data to anyone, right?

2. If I understand correctly, the your proposed solution is something like this:

a. Have the server code authenticate the very first request.  Assume valid credential, then create a secret and return along in the JSON payload.   

b. In subsequent requests, have the server code authenticate using the secrets from previous responses and keep generate new secrets to send back in each response?

Thanks for clarifying.</description>
		<content:encoded><![CDATA[<p>Douglas,<br />
Great article.  Everything is well explained, except I am still confused by the section &#8220;Don&#8217;t Send Data to Strangers&#8221; and your previous answer to TC.</p>
<p>Why am I confused? </p>
<p>1. So external scripts are dangerous, we hear that.  But even if I do not include any external script, this still remains as a valid concern, right?  Because someone evil do NOT really need me to include their evil scripts in order to steal information, they can just make the requests directly to my server?  Without any form of authentication, my server cannot tell whether the request come from my page or anywhere else, and it&#8217;s bad if my server blindly return the JSON data to anyone, right?</p>
<p>2. If I understand correctly, the your proposed solution is something like this:</p>
<p>a. Have the server code authenticate the very first request.  Assume valid credential, then create a secret and return along in the JSON payload.   </p>
<p>b. In subsequent requests, have the server code authenticate using the secrets from previous responses and keep generate new secrets to send back in each response?</p>
<p>Thanks for clarifying.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sivaraj</title>
		<link>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-164762</link>
		<dc:creator>Sivaraj</dc:creator>
		<pubDate>Tue, 31 Jul 2007 08:32:55 +0000</pubDate>
		<guid>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-164762</guid>
		<description>I've some issues with JSON string.
can anyone tell me the reason for not allowing # and ;.

In my application I've have escape utility, which escapes all special character to a standard ECMA character. Which will be like "&#38;#"+charCode+";"

This works in all cases like string to XML, string to HTML and XML to html.

when i try to use JSON as my data interchange format, it is not tokenizing my string which has got ECMA characters.

Thanks,
Sivaraj.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve some issues with JSON string.<br />
can anyone tell me the reason for not allowing # and ;.</p>
<p>In my application I&#8217;ve have escape utility, which escapes all special character to a standard ECMA character. Which will be like &#8220;&amp;#&#8221;+charCode+&#8221;;&#8221;</p>
<p>This works in all cases like string to XML, string to HTML and XML to html.</p>
<p>when i try to use JSON as my data interchange format, it is not tokenizing my string which has got ECMA characters.</p>
<p>Thanks,<br />
Sivaraj.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elliot Murphy 28:1 &#187; Blog Archive &#187; links for 2007-07-25</title>
		<link>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-161758</link>
		<dc:creator>Elliot Murphy 28:1 &#187; Blog Archive &#187; links for 2007-07-25</dc:creator>
		<pubDate>Wed, 25 Jul 2007 23:25:55 +0000</pubDate>
		<guid>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-161758</guid>
		<description>[...] JSON and Browser Security » Yahoo! User Interface Blog JSON is a data interchange format. It is used in the transmission of data between machines. Since it carries only data, it is security-neutral. The security of systems that use JSON is determined by the quality of the design of those systems. JSON itself [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] JSON and Browser Security » Yahoo! User Interface Blog JSON is a data interchange format. It is used in the transmission of data between machines. Since it carries only data, it is security-neutral. The security of systems that use JSON is determined by the quality of the design of those systems. JSON itself [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 开发者 &#187; Blog Archive &#187; 原创翻译：JSON和浏览器安全(作者：Douglas Crockford)</title>
		<link>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-149109</link>
		<dc:creator>开发者 &#187; Blog Archive &#187; 原创翻译：JSON和浏览器安全(作者：Douglas Crockford)</dc:creator>
		<pubDate>Fri, 29 Jun 2007 13:23:29 +0000</pubDate>
		<guid>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-149109</guid>
		<description>[...] April 10, 2007 at 10:14 am by Douglas Crockford 翻译：Frank Cheung 文章出处：http://yuiblog.com/blog/2007/04/10/json-and-browser-security [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] April 10, 2007 at 10:14 am by Douglas Crockford 翻译：Frank Cheung 文章出处：http://yuiblog.com/blog/2007/04/10/json-and-browser-security [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Metro</title>
		<link>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-103732</link>
		<dc:creator>Tom Metro</dc:creator>
		<pubDate>Thu, 03 May 2007 03:09:17 +0000</pubDate>
		<guid>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-103732</guid>
		<description>The correct URL for the article mentioned in a comment &lt;a href="#comment-90175" rel="nofollow"&gt;above&lt;/a&gt; is:
http://www.port80software.com/200ok/archive/2007/03/15/29258.aspx

It basically says to incorporate rules on the server side to validate the referrer header as part of the authorization process.

However, I think this approach is equally vulnerable to an attack that exploits XSS to inject a rogue SCRIPT tag into the target application's HTML. The rogue JavaScript will run in the application's context, have access to its secretes, and requests it makes to your server (if well engineered) will be indistinguishable from legitimate requests.

 -Tom</description>
		<content:encoded><![CDATA[<p>The correct URL for the article mentioned in a comment <a href="#comment-90175" rel="nofollow">above</a> is:<br />
<a href="http://www.port80software.com/200ok/archive/2007/03/15/29258.aspx" rel="nofollow">http://www.port80software.com/200ok/archive/2007/03/15/29258.aspx</a></p>
<p>It basically says to incorporate rules on the server side to validate the referrer header as part of the authorization process.</p>
<p>However, I think this approach is equally vulnerable to an attack that exploits XSS to inject a rogue SCRIPT tag into the target application&#8217;s HTML. The rogue JavaScript will run in the application&#8217;s context, have access to its secretes, and requests it makes to your server (if well engineered) will be indistinguishable from legitimate requests.</p>
<p> -Tom</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JP</title>
		<link>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-95134</link>
		<dc:creator>JP</dc:creator>
		<pubDate>Fri, 20 Apr 2007 11:21:52 +0000</pubDate>
		<guid>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-95134</guid>
		<description>Tim, yup totally agree (the link above goes to my blog post about it), the nonce really is an excessive level of paranoia, which is probably only worthwhile for very specific applications (Amazon's S3 as an example - and they don't even do real server generated Nonce's...but anyway).  Some sort of per session key is probably enough for all applications.</description>
		<content:encoded><![CDATA[<p>Tim, yup totally agree (the link above goes to my blog post about it), the nonce really is an excessive level of paranoia, which is probably only worthwhile for very specific applications (Amazon&#8217;s S3 as an example - and they don&#8217;t even do real server generated Nonce&#8217;s&#8230;but anyway).  Some sort of per session key is probably enough for all applications.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim McCormack</title>
		<link>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-93852</link>
		<dc:creator>Tim McCormack</dc:creator>
		<pubDate>Wed, 18 Apr 2007 14:31:38 +0000</pubDate>
		<guid>http://yuiblog.com/blog/2007/04/10/json-and-browser-security/#comment-93852</guid>
		<description>jp, the reason you can't do a "rolling nonce" (to coin a phrase) is that we're dealing with asynchronous requests. You aren't guaranteed a response (with new key) to occur before the next request.

Additionally, we should consider the spectre of multiple tabs or windows. New authentication keys must be shared between open views. (Cookie-based storage of authentication keys?)</description>
		<content:encoded><![CDATA[<p>jp, the reason you can&#8217;t do a &#8220;rolling nonce&#8221; (to coin a phrase) is that we&#8217;re dealing with asynchronous requests. You aren&#8217;t guaranteed a response (with new key) to occur before the next request.</p>
<p>Additionally, we should consider the spectre of multiple tabs or windows. New authentication keys must be shared between open views. (Cookie-based storage of authentication keys?)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.301 seconds -->
