Socket
Socket
Sign inDemoInstall

ses

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ses

**:warning: This is not an official, working packaging of Google Caja’s SES. This is a project attempting to bring SES to Node.js but will probably not be viable until Node.js 0.12 at least.**


Version published
Weekly downloads
33K
decreased by-22.52%
Maintainers
1
Weekly downloads
 
Created
Source

Secure EcmaScript

:warning: This is not an official, working packaging of Google Caja’s SES. This is a project attempting to bring SES to Node.js but will probably not be viable until Node.js 0.12 at least.

SES is a tool that allows mutually suspicious programs to share a single EcmaScript 5 compliant JavaScript context without interfering with each other. It does this by freezing everything that is accessible in global scope, removing interfaces that would allow programs to interfe with each-other, and providing the ability to evaluate arbitrary code in isolation.

SES is a part of the Google Caja project. For JavaScript contexts that do not support EcmaScript 5, Caja depends on compiling JavaScript to a JavaScript subset with static verification and run-time assertions to maintain isolation. With EcmaScript 5, it is possible to run isolated code without a compilation step or run-time checks.

Initialize SES by executing these scripts in order.

  • logger.js
  • repairES5.js
  • WeakMap.js
  • debug.js
  • StringMap.js
  • whitelist.js
  • atLeastFreeVarNames.js
  • startSES.js
  • ejectorsGuardsTrademarks.js
  • hookupSESPlus.js

This is an example of initializing SES in a web page.

<script src="logger.js"></script>
<script src="repairES5.js"></script>
<script src="WeakMap.js"></script>
<script src="debug.js"></script>
<script src="StringMap.js"></script>
<script src="whitelist.js"></script>
<script src="atLeastFreeVarNames.js"></script>
<script src="startSES.js"></script>
<script src="ejectorsGuardsTrademarks.js"></script>
<script src="hookupSESPlus.js"></script>

This is an example of initializing SES in Node.

var FS = require("fs");
var VM = require("vm");
 
var source = FS.readFileSync("initSes.js");
var script = new VM.Script(source);
script.runInThisContext();
 
var f = cajaVM.compileExpr("console.log('hi')");
f({console: console});

Included is a binary runner under the name ses

ses example/code.js

FAQs

Package last updated on 10 Apr 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc