Summary
Angular Expressions - Remote Code Execution when using locals
Workarounds
There is one workaround if it not possible for you to update :
- Make sure that you use the compiled function with just one argument : ie this is not vulnerable :
const result = expressions.compile("__proto__.constructor")({});: in this case you lose the feature of locals if you need it.
Credits
Credits go to JorianWoltjer who has found the issue and reported it to use. https://jorianwoltjer.com/
Impact
An attacker can write a malicious expression that escapes the sandbox to execute arbitrary code on the system.
Example of vulnerable code:
const expressions = require("angular-expressions");
const result = expressions.compile("__proto__.constructor")({}, {});
// result should be undefined, however for versions <=1.4.2, it returns an object.
With a more complex (undisclosed) payload, one can get full access to Arbitrary code execution on the system.
Untrusted input is evaluated as executable code within the application's runtime environment. Typical impact: arbitrary code execution within the application's privilege context.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
The problem has been patched in version 1.4.3 of angular-expressions.
Frequently Asked Questions
- What is CVE-2024-54152? CVE-2024-54152 is a critical-severity code injection vulnerability in angular-expressions (npm), affecting versions < 1.4.3. It is fixed in 1.4.3. Untrusted input is evaluated as executable code within the application's runtime environment.
- Which versions of angular-expressions are affected by CVE-2024-54152? angular-expressions (npm) versions < 1.4.3 is affected.
- Is there a fix for CVE-2024-54152? Yes. CVE-2024-54152 is fixed in 1.4.3. Upgrade to this version or later.
- Is CVE-2024-54152 exploitable, and should I be worried? Whether CVE-2024-54152 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2024-54152 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2024-54152? Upgrade
angular-expressionsto 1.4.3 or later.