Google Caja

The Caja Compiler is a tool for making third party HTML, CSS and JavaScript safe to embed in your website. It enables rich interaction between the embedding page and the embedded applications. Caja uses an object-capability security model to allow for a wide range of flexible security policies, so that your website can effectively control what embedded third party code can do with user data.

The Caja Compiler supports most HTML and CSS and the recently standardized “strict mode” JavaScript version of JavaScript — even on older browsers that do not support strict mode. It allows third party code to use new JavaScript features on older browsers that do not support them.

Aside from Google, MySpace knows it best:

The general idea behind Caja… is to scrub JavaScript and prevent malware. The tools can’t come soon enough. Third party social applications are a security disaster waiting to happen. Meanwhile, there has been little formal testing of these third party apps. Take vulnerable software, couple it with a social network and you have hacker paydirt. For instance, ActiveX controls have been a major security headache (MySpace doesn’t support ActiveX).