gf3 / sandbox

A nifty JavaScript sandbox for Node.js
ISC License
844 stars 123 forks source link

[fix] leaky functions and globals #10

Closed bmeck closed 12 years ago

bmeck commented 12 years ago

This should fix the following:

Function constructor attack (use a comm channel instead of naive function). Leaking global attack (easy Function wrapper). Type coercion attack (serialize inside the sandbox, though you may want to add a circular dependency serializer inside the sandbox). Function.caller attack (fixed by strict mode). Function.arguments attack (fixed by strict mode). Native prototype attack (fixed by lack of leaks from others, hooking Function.prototype.call from leaked function for example).

I added some basic examples.