{"id":"GHSA-5462-4vcx-jh7j","summary":"Angular Expressions - Remote Code Execution when using locals","details":"### Impact\n\nAn attacker can write a malicious expression that escapes the sandbox to execute arbitrary code on the system.\n\nExample of vulnerable code:\n\n```js\nconst expressions = require(\"angular-expressions\");\nconst result = expressions.compile(\"__proto__.constructor\")({}, {});\n// result should be undefined, however for versions \u003c=1.4.2, it returns an object.\n```\n\nWith a more complex (undisclosed) payload, one can get full access to Arbitrary code execution on the system.\n\n### Patches\n\nThe problem has been patched in version 1.4.3 of angular-expressions.\n\n### Workarounds\n\nThere is one workaround if it not possible for you to update : \n\n* Make sure that you use the compiled function with just one argument : ie this is not vulnerable : \n    `const result = expressions.compile(\"__proto__.constructor\")({});` : in this case you lose the feature of locals if you need it.\n\n### Credits\n\nCredits go to [JorianWoltjer](https://github.com/JorianWoltjer) who has found the issue and reported it to use. https://jorianwoltjer.com/","aliases":["CVE-2024-54152"],"modified":"2024-12-10T20:59:46Z","published":"2024-12-10T16:54:50Z","database_specific":{"severity":"CRITICAL","github_reviewed":true,"github_reviewed_at":"2024-12-10T16:54:50Z","nvd_published_at":"2024-12-10T16:15:23Z","cwe_ids":["CWE-94"]},"references":[{"type":"WEB","url":"https://github.com/peerigon/angular-expressions/security/advisories/GHSA-5462-4vcx-jh7j"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-54152"},{"type":"WEB","url":"https://github.com/peerigon/angular-expressions/commit/97f7ad94006156eeb97fc942332578b6cfbf8eef"},{"type":"PACKAGE","url":"https://github.com/peerigon/angular-expressions"}],"affected":[{"package":{"name":"angular-expressions","ecosystem":"npm","purl":"pkg:npm/angular-expressions"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.4.3"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/12/GHSA-5462-4vcx-jh7j/GHSA-5462-4vcx-jh7j.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V4","score":"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"}]}