GitHub Advisoryadvisory · npm

GHSA-5462-4vcx-jh7j Angular Expressions - Remote Code Execution when using locals

CRITICAL Published 2024-12-10 Modified 2024-12-10 Official page ↗
Aliases
CVE-2024-54152
Ecosystem
npm
Packages
angular-expressions
Severity
Critical
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Weaknesses
CWE-94
Reviewed
2024-12-10

Affected packages

• npm angular-expressions: < 1.4.3 → fixed in 1.4.3

Description

Impact An attacker can write a malicious expression that escapes the sandbox to execute arbitrary code on the system. Example of vulnerable code: ```js 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. Patches The problem has been patched in version 1.4.3 of angular-expressions. 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/

Related

Alias · CVE (1)

  • CVE-2024-54152 Angular Expressions provides expressions for the Angular.JS web framework as a standalone module. vulnerability

Weakness · CWE (1)

  • CWE-94 Improper Control of Generation of Code weakness

References