CVE-2021-23771: Sandbox escape in notevil and argencoders-notevil
Summary
CVE-2021-23771: Sandbox escape in notevil and argencoders-notevil. Affects notevil versions < 1.3.3. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The notevil package is an npm package that provides a sandbox environment for executing untrusted JavaScript code. It is commonly used for tasks such as code evaluation and dynamic code generation. The argencoders-notevil package is a fork of notevil that adds additional features and functionality. Both packages are vulnerable to a Sandbox Escape leading to Prototype pollution. This vulnerability allows an attacker to add or modify an object's prototype, potentially leading to arbitrary code execution or information disclosure.
Vulnerability Detail
The vulnerability arises from a failure to restrict access to the main context in both the notevil and argencoders-notevil packages. This allows an attacker to bypass the sandbox environment and manipulate the prototype of an object. By modifying the prototype, an attacker can introduce malicious behavior into the code execution, potentially leading to remote code execution or other security issues. This vulnerability has been assigned a CVSS score of 6.5, indicating a moderate severity.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
If updating to the latest version is not immediately possible, a temporary workaround is to avoid using the affected packages in scenarios where untrusted code execution is required. Instead, consider using alternative sandboxing solutions or implementing custom security measures to mitigate the risk of prototype pollution.
Conclusion
The notevil and argencoders-notevil packages are vulnerable to a Sandbox Escape leading to Prototype pollution. It is crucial to update to the latest patched versions of these packages to mitigate the risk of remote code execution and other security issues. If immediate updating is not possible, consider using alternative sandboxing solutions or implementing custom security measures. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for notevil →
FAQ
Prototype pollution is a vulnerability that occurs when an attacker is able to modify the prototype of an object, leading to unexpected behavior or security issues. In the context of JavaScript, this can allow an attacker to modify built-in objects or introduce malicious behavior into the code execution.
Yes, all versions of the notevil and argencoders-notevil packages are vulnerable to this sandbox escape vulnerability. It is recommended to update to the latest patched version to mitigate the risk.
At the time of this advisory, there are no known public exploits for this vulnerability. However, it is important to apply the recommended patches and security updates to prevent potential exploitation.
Yes, this vulnerability can be exploited remotely if an attacker is able to execute untrusted code within the affected sandbox environment. By manipulating the prototype of an object, an attacker can potentially execute arbitrary code or access sensitive information.
Yes, there are alternative sandboxing solutions available in the JavaScript ecosystem. Some popular options include vm2, sandbox, and js-slang. These packages provide similar functionality to notevil and argencoders-notevil but may have different security implementations.
References
Related vulnerabilities
Recent vulnerabilities recorded for notevil.