vat - No Fluff Just Stuff

vat

Posted by: Douglas Crockford on March 24, 2008

The HTML environment lacks modularity. It is not possible to run guest code and be confident that it will not attack. Some of the popular attacks are XSS, XSRF, and Phishing. This deficiency is a huge source of insecurity. The <iframe> has been suggested as a sandboxed container, but the <iframe> is subject to two out of three attacks, so it is far from safe.

I have proposed that we replace <iframe> with <module>. The <module> is a vat that prohibits all three attacks (although as long as we have JavaScript and the DOM, it will still be subject to internal XSS attacks). It may be easier to provide an option that lets <iframe> and <frame> and <body> behave like vats.

If we add a vat attribute to an insecure container, then the container is locked down. It is not allowed to access the DOM tree of another container. Other containers are not allowed to access its DOM tree. Navigation (location) of other containers is not allowed. HTTP requests made from a container to sites other than the container's domain do not carry cookies or other ambient authority. A script should be able to easily determine if it is in a vat or not. The vat attribute is included in the http requests for the vat's assets.

The only local way that a vat container can interact with another container is with a communications mechanism such as Cross Document Messaging (XDM). If we had such containment, we could include components from other sites using a notation such as <iframe vat src="pirate.net/theworst.html">. The browser would then be fully minimally adequate for mashups.

It will still be a dangerous environment, and will continue to be dangerous until we replace JavaScript and the DOM. But this small improvement would move us way ahead. The construction of secure mashups will no longer be impossible, just risky.

Douglas Crockford

About Douglas Crockford

Crock is a product of our public school system. A registered voter, he owns his own car. He has developed office automation systems. He did research in games and music at Atari. He was Director of Technology at Lucasfilm. He was Director of New Media at Paramount. He was the founder and CEO of Electric Communities/Communities.com. He was founder and CTO of State Software, where he discovered JSON. He is now an architect at Yahoo!.

Why Attend the NFJS Tour?

  • » Cutting-Edge Technologies
  • » Agile Practices
  • » Peer Exchange

Current Topics:

  • Languages on the JVM: Scala, Groovy, Clojure
  • Enterprise Java
  • Core Java, Java 8
  • Agility
  • Testing: Geb, Spock, Easyb
  • REST
  • NoSQL: MongoDB, Cassandra
  • Hadoop
  • Spring 4
  • Cloud
  • Automation Tools: Gradle, Git, Jenkins, Sonar
  • HTML5, CSS3, AngularJS, jQuery, Usability
  • Mobile Apps - iPhone and Android
  • More...
Learn More »