JSON

Exploring open structured data interchange

« PreviousNext »

W3C - Enabling Read Access for Web Resources

16 November 2007

W3C has recently created a proposal for adding cross domain capabilities to the XMLHttpRequest (XHR) object. The proposal specifies how XHR can communicate with servers so that servers can explicitly opt-in to provide controlled access to their resources from other sites. I believe this proposal has great potential for providing a solid robust mechanism for secure mashups that isn’t built on various hacks. A number of things to understand about this proposal:

This proposal seeks to adds similiar functionality as JSONRequest in terms of adding secure cross site access. Here is a short contrast between JSONRequest and this new proposal (W3C/AC):

  JSONRequest W3C/AC
Format constraint JSON data only Any format (provided as text through XHR)
Opt-in method Add header Content-Type:application/json-request Add header Access-Control: allow <*.example.org>
Domain Control Only programmatically based off request source information Fine grained control determined by Access-Control information
Performance JSON can be parsed natively for improved performance non-GET operations required a previous GET operation which can take extra time
Headers Cookies removed, no user defined headers Cookies and headers may still be sent. Spec advices agents not to expose any trusted data, such as cookies, HTTP header data, inappropriately, but it is unclear how that is determined.
HTTP Methods GET, POST Any (non-GET require explicit permission)
POST access No prior authentication required (but cookies are still stripped) Must be explicitly allowed in headers prior to the POST

The W3C/AC in combination with getters/setters and a possible sandboxing mechanism in ES4 would also potentially allow sites to load and sandbox cross site advertisement scripts (one of the greatest XSS vulnerabilities on the web). I am all for this proposal. I know that new proposals that could open new vulnerabilities naturally cause fear and uncertainty, but this is a well thought out proposal that provides a solid mechanism for providiong cross site data, and is vastly better than the hacks we are currently working with. Both W3C/AC and JSONRequest would be both be fantastic additions to the browsers and open up huge opportunities for improving security of cross-domain mashups.

Posted in Security | Trackback | del.icio.us | Top Of Page

    One Response to “W3C - Enabling Read Access for Web Resources”

  1. How to Get Six Pack Fast Says:

    I can tell that this is not the first time at all that you write about this topic. Why have you chosen it again?

Leave a Reply