Ecosyste.ms: Advisories
An open API service providing security vulnerability metadata for many open source software ecosystems.
Security Advisories: GSA_kwCzR0hTQS01NDYyLTR2Y3gtamg3as4ABCOd
Angular Expressions - Remote Code Execution when using locals
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.
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/
Permalink: https://github.com/advisories/GHSA-5462-4vcx-jh7jJSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS01NDYyLTR2Y3gtamg3as4ABCOd
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Critical
Classification: General
Published: 16 days ago
Updated: 16 days ago
EPSS Percentage: 0.00043
EPSS Percentile: 0.10788
Identifiers: GHSA-5462-4vcx-jh7j, CVE-2024-54152
References:
- https://github.com/peerigon/angular-expressions/security/advisories/GHSA-5462-4vcx-jh7j
- https://github.com/peerigon/angular-expressions/commit/97f7ad94006156eeb97fc942332578b6cfbf8eef
- https://nvd.nist.gov/vuln/detail/CVE-2024-54152
- https://github.com/advisories/GHSA-5462-4vcx-jh7j
Blast Radius: 0.0
Affected Packages
npm:angular-expressions
Dependent packages: 85Dependent repositories: 849
Downloads: 201,636 last month
Affected Version Ranges: < 1.4.3
Fixed in: 1.4.3
All affected versions: 0.1.0, 0.2.0, 0.2.1, 0.3.0, 1.0.0, 1.0.1, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.1.9, 1.1.10, 1.2.0, 1.2.1, 1.3.0, 1.4.0, 1.4.1, 1.4.2
All unaffected versions: 1.4.3