
Cloud Vulnerability DB
A community-led vulnerabilities database
The localeval npm package was found to contain a critical sandbox escape vulnerability (GHSA-mmqv-m45h-q2hp) that could lead to Remote Code Execution. The vulnerability affects all versions from 0.0.0 to versions prior to 15.3.0, and was disclosed on September 4, 2020. The package failed to properly restrict access to the main context through constructor.constructor, which could allow attackers to break out of the intended sandbox environment (GitHub Advisory).
The vulnerability stems from improper sandbox implementation where the package fails to restrict access to the main context through constructor.constructor. This allows attackers to execute arbitrary code outside the sandbox environment. A proof of concept demonstrates that evaluating the payload constructor.constructor("return process.env")() returns the contents of process.env, effectively breaking out of the sandbox. The issue was initially identified in the function prototype implementation in the browser context, where the function was being called with fn.apply(0, ...), causing the 'this' object to be a number and leaking the Number prototype into the environment (GitHub Commit).
The vulnerability allows attackers to access variables outside the sandbox and execute non-sandboxed code. This means attackers can potentially access sensitive information and execute arbitrary code with the same privileges as the application running the localeval package. For example, attackers could access hidden variables and execute system commands like process.exit() (GitHub Issue).
The vulnerability is easily exploitable as demonstrated by multiple proof of concept examples. An attacker can break the sandbox using simple JavaScript code patterns like this.constructor.constructor('return hiddenVariable')() to access variables outside the sandbox, or this.constructor.constructor('process.exit(0)')() to execute arbitrary code on Node.js systems (GitHub Issue).
No official fix is currently available for this vulnerability. The recommended action is to consider using an alternative package until a fix is made available. Some attempts at mitigation included setting uid and gid for the evaluator process to limit potential damage from exploitation, but these measures do not fully address the core vulnerability (GitHub Advisory, GitHub Commit).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."