My favorites | Sign in
Logo
                
Search
for
Updated Jul 17, 2009 by metaweta
CajaOverview  
Overview of the Caja system

Introduction

Caja is a system, written in Java and built using Ant, for enabling the safe inclusion of untrusted third-party web content (HTML, CSS and Javascript code) into a host page. Each chunk of web content is rewritten, or "cajoled", into a "module", consisting of some static HTML and some Javascript. Each module is isolated from every other module except by means of object references granted to the modules by the host page.

Design considerations

Threat model

Desired features

Resulting languages

Cajita

Removes from javascript "sharp knives"

Adds to javascript
  • cajita.freeze
  • immutable objects
Interoperates well with existing browser api
  • A decent language to program in!

Threats & features:

Valija

Adds back into Cajita "toy knives": they behave like the Javascript knives, but only within a Cajita module. Valija code cannot interfere with code in other modules.

For example, one can write

Object.prototype.x = 1;

in Valija, and all objects in that module will appear to have an x property. But objects in other modules will be unaffected.

Threats & features:

Tools

Web content is rewritten using the Java cajoler. There is a command-line version (bin/cajole_html), an interactive applet version (ant-www/testbed), a cajoling service on App Engine (http://caja.appspot.com), and a Java class for use by those that want to cajole code themselves (used by Yahoo! and Shindig, for example).


Sign in to add a comment