{"id":"CVE-2021-21277","aliases":["CVE-2021-21277","GHSA-j6px-jwvv-vpwq"],"related":[],"kind":"vulnerability","state":"published","title":"Angular Expressions - Remote Code Execution","summary":"angular-expressions is \"angular's nicest part extracted as a standalone module for the browser and node\". In angular-expressions before version 1.1.2 there is a vulnerability which allows Remote Code Execution if you call \"expressions.compile(userControlledInput)\" where \"userControlledInput\" is text that comes from user input. The security of the package could be bypassed by using a more complex payload, using a \".constructor.constructor\" technique. In terms of impact: If running angular-expressions in the browser, an attacker could run any browser script when the application code calls expressions.compile(userControlledInput). If running angular-expressions on the server, an attacker could run any Javascript expression, thus gaining Remote Code Execution. This is fixed in version 1.1.2 of angular-expressions A temporary workaround might be either to disable user-controlled input that will be fed into angular-expressions in your application or allow only following characters in the userControlledInput.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"angular-expressions is \"angular's nicest part extracted as a standalone module for the browser and node\". In angular-expressions before version 1.1.2 there is a vulnerability which allows Remote Code Execution if you call \"expressions.compile(userControlledInput)\" where \"userControlledInput\" is text that comes from user input. The security of the package could be bypassed by using a more complex payload, using a \".constructor.constructor\" technique. In terms of impact: If running angular-expressions in the browser, an attacker could run any browser script when the application code calls expressions.compile(userControlledInput). If running angular-expressions on the server, an attacker could run any Javascript expression, thus gaining Remote Code Execution. This is fixed in version 1.1.2 of angular-expressions A temporary workaround might be either to disable user-controlled input that will be fed into angular-expressions in your application or allow only following characters in the userControlledInput.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"angular-expressions son \"angular's nicest part extracted as a standalone module for the browser and node\".&#xa0;En angular-expressions anteriores a la versión 1.1.2, existe una vulnerabilidad que permite una Ejecución de Código Remota si llama a \"expression.compile(userControlledInput)\" donde \"userControlledInput\" es texto que proviene de la entrada del usuario.&#xa0;La seguridad del paquete podría omitirse usando una carga útil más compleja, utilizando una técnica \".constructor.constructor\".&#xa0;En términos de impacto: si ejecuta angular-expressions en el navegador, un atacante podría ejecutar cualquier script del navegador cuando el código de la aplicación llame a expression.compile(userControlledInput).&#xa0;Si ejecuta angular-expressions en el servidor, un atacante podría ejecutar cualquier expresión de Javascript, obteniendo así una ejecución de código remota.&#xa0;Esto se corrigió en la versión 1.1.2 de angular-expressions. Una solución temporal podría ser deshabilitar la entrada controlada por el usuario que se alimentará en angular-expressions en su aplicación o permitir solo seguir caracteres en el userControlledInput","source":"nvd"}],"published":"2021-02-01T15:01:26.000Z","modified":"2026-09-10T03:49:14.136Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N","score":8.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N","score":8.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:S/C:P/I:P/A:P","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-74","CWE-94"],"affected":[{"ranges":[{"version":"< 1.1.2","status":"affected"}],"vendor":"peerigon","product":"angular-expressions","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.1.2"}],"ecosystem":"npm","package":"angular-expressions","purl":"pkg:npm/angular-expressions","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.1.2"}],"vendor":"peerigon","product":"angular-expressions","cpe":"cpe:2.3:a:peerigon:angular-expressions:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/peerigon/angular-expressions/security/advisories/GHSA-j6px-jwvv-vpwq","tags":["vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.npmjs.com/package/angular-expressions","tags":["product","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"http://blog.angularjs.org/2016/09/angular-16-expression-sandbox-removal.html","tags":["broken-link","vendor-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/peerigon/angular-expressions/commit/07edb62902b1f6127b3dcc013da61c6316dd0bf1","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21277","tags":["advisory"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-21277","url":"https://www.cve.org/CVERecord?id=CVE-2021-21277","licence":"CVE Terms of Use","modified":"2024-08-03T18:09:15.102Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-j6px-jwvv-vpwq","url":"https://github.com/advisories/GHSA-j6px-jwvv-vpwq","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:14.136Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-21277","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21277","licence":"Public domain","modified":"2026-06-17T03:35:10.707Z"}],"updatedAt":"2026-11-25T22:57:59.770Z","epss":{"score":0.02848,"percentile":0.87082,"date":"2026-12-01T12:00:22.000Z"}}