Socket
Socket
Sign inDemoInstall

ses

Package Overview
Dependencies
Maintainers
2
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ses - npm Package Compare versions

Comparing version 0.0.1 to 0.1.2

.gitmodules

32

package.json
{
"name": "ses",
"version": "0.0.1",
"dependencies": {
"optimist": "~0.3.5"
"version": "0.1.2",
"description": "Secure ECMAScript",
"main": "src/index.js",
"scripts": {
"test": "node scripts/build-intermediate.js && tape -r esm test/**/*.js",
"just-test": "tape -r esm test/**/*.js",
"build-intermediate": "node scripts/build-intermediate.js",
"build": "node scripts/build-intermediate.js && rollup --format=iife --output.name=SES --sourcemap --file=dist/ses-shim.js -- src/index.js"
},
"preferGlobal": true,
"bin": {
"ses": "bin/ses"
}
"devDependencies": {
"esm": "^3.0.37",
"rollup": "^0.63.4",
"rollup-plugin-node-resolve": "^3.3.0",
"tape": "^4.9.0"
},
"dependencies": {},
"repository": {
"type": "git",
"url": "git+https://github.com/Agoric/SES.git"
},
"author": "Agoric",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/Agoric/SES/issues"
},
"homepage": "https://github.com/Agoric/SES#readme"
}

@@ -0,68 +1,57 @@

# Secure EcmaScript (SES)
# Secure EcmaScript
[![Build Status][travis-svg]][travis-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
**: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.**
Secure EcmaScript (SES) is a frozen environment for running EcmaScript
(Javascript) 'strict' mode programs with no ambient authority in their global
scope, and with the addition of a safe two-argument evaluator
(`SES.confine(code, endowments)`). By freezing everything accessible from the
global scope, it removes programs abilities to interfere with each other, and
thus enables isolated evaluation of arbitrary code.
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.
It runs atop an ES6-compliant platform, enabling safe interaction of
mutually-suspicious code, using object-capability -style programming.
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.
See https://github.com/Agoric/Jessie to see how SES fits into the various
flavors of confined EcmaScript execution. And visit
https://cdn.rawgit.com/Agoric/SES/0.1.0/demo/ for a demo.
Initialize SES by executing these scripts in order.
Derived from the Caja project, https://github.com/google/caja/wiki/SES .
- `logger.js`
- `repairES5.js`
- `WeakMap.js`
- `debug.js`
- `StringMap.js`
- `whitelist.js`
- `atLeastFreeVarNames.js`
- `startSES.js`
- `ejectorsGuardsTrademarks.js`
- `hookupSESPlus.js`
Still under development: do not use for production systems yet, there are
known security holes that need to be closed.
This is an example of initializing SES in a web page.
Incorporates (as a git submodule) the Realms shim from
https://github.com/tc39/proposal-realms .
```html
<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>
```
### Bug Disclosure
This is an example of initializing SES in Node.
Despite this not being ready for production use, we'd like to get into the
practice of responsible disclosure. If you find a security-sensitive bug that
should not be revealed publically until a fix is available, please send email
to `security` at (@) `agoric.com`. To encrypt, please use my (@warner)
personal GPG key [A476E2E6 11880C98 5B3C3A39 0386E81B
11CAA07A](http://www.lothar.com/warner-gpg.html) . Keybase users can also
send messages to `@agoric_security`, or share code and other log files via
the Keybase encrypted file system
(`/keybase/private/agoric_security,$YOURNAME`).
```javascript
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});
```
For non-security bugs, use the
[regular Issues page](https://github.com/Agoric/SES/issues).
Included is a binary runner under the name `ses`
```bash
ses example/code.js
```
<!-- [![Coverage Status][coveralls-svg]][coveralls-url] -->
[travis-svg]: https://travis-ci.com/Agoric/SES.svg?branch=master
[travis-url]: https://travis-ci.com/Agoric/SES
[coveralls-svg]: https://coveralls.io/repos/github/Agoric/SES/badge.svg
[coveralls-url]: https://coveralls.io/github/Agoric/SES
[deps-svg]: https://david-dm.org/Agoric/SES.svg
[deps-url]: https://david-dm.org/Agoric/SES
[dev-deps-svg]: https://david-dm.org/Agoric/SES/dev-status.svg
[dev-deps-url]: https://david-dm.org/Agoric/SES?type=dev
[license-image]: https://img.shields.io/badge/License-Apache%202.0-blue.svg
[license-url]: shim/LICENSE
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