{"id":"CVE-2021-21277","aliases":["GHSA-j6px-jwvv-vpwq"],"url":"https://o3.security/vulnerability/CVE-2021-21277","summary":"Angular Expressions - Remote Code Execution","details":"### Impact\n\nThe vulnerability, reported by GoSecure Inc, allows Remote Code Execution, if you call `expressions.compile(userControlledInput)` where `userControlledInput` is text that comes from user input.\n\nThis time, the security of the package could be bypassed by using a more complex payload, using a `.constructor.constructor` technique.\n\n* If running angular-expressions in the browser, an attacker could run any browser script when the application code calls expressions.compile(userControlledInput).\n* If running angular-expressions on the server, an attacker could run any Javascript expression, thus gaining Remote Code Execution.\n\n### Patches\n\nUsers should upgrade to version 1.1.2 of angular-expressions\n\n### Workarounds\n\nA temporary workaround might be either to : \n\n* disable user-controlled input that will be fed into angular-expressions in your application\n\nOR\n\n* allow only following characters in the userControlledInput : \n\n```js\nif (/^[|a-zA-Z.0-9 :\"'+-?]+$/.test(userControlledInput)) {\n      var result = expressions.compile(userControlledInput);\n}\nelse {\n     result = undefined;\n}\n```\n\n### References\n\n[Removal of angular-expression sandbox](http://blog.angularjs.org/2016/09/angular-16-expression-sandbox-removal.html)\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [angular-expressions](https://github.com/peerigon/angular-expressions/issues)\n* [Email us](mailto:contact@javascript-ninja.fr)\n\n### Credits \n\nThe issue was reported by Maxime Nadeau from GoSecure, Inc.","published":"2021-02-01T15:15:13.340Z","modified":"2026-07-09T01:25:35.780579Z","cvss":{"score":8.8,"severity":"HIGH","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"},"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"angular-expressions","fixedVersion":"1.1.2"}],"fix":{"url":"https://github.com/peerigon/angular-expressions/commit/07edb62902b1f6127b3dcc013da61c6316dd0bf1","label":"peerigon/angular-expressions@07edb62"},"references":[{"type":"WEB","url":"https://www.npmjs.com/package/angular-expressions"},{"type":"ADVISORY","url":"http://blog.angularjs.org/2016/09/angular-16-expression-sandbox-removal.html"},{"type":"ADVISORY","url":"https://github.com/peerigon/angular-expressions/security/advisories/GHSA-j6px-jwvv-vpwq"},{"type":"FIX","url":"https://github.com/peerigon/angular-expressions/commit/07edb62902b1f6127b3dcc013da61c6316dd0bf1"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21277"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-07-09T01:25:35.780579Z"}}