CVE-2021-21277 Details
Description
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.
A remote code execution vulnerability exists in the angular-expressions package, prior to version 1.1.2. This vulnerability allows an attacker to execute arbitrary code by passing user-controlled input to the expressions.compile() function. The issue can be exploited in both browser and server environments. In the browser, any script can be executed, while on the server, any JavaScript expression can be run, leading to remote code execution.
Users are advised to upgrade to version 1.1.2 of angular-expressions, which addresses the vulnerability by disallowing access to the prototype chain. For those unable to upgrade, a temporary workaround is to disable user-controlled input to angular-expressions or to sanitize the input by allowing only certain characters.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
No SSVC data is available for this CVE.
References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| http://blog.angularjs.org/2016/09/angular-16-expression-sandbox-removal.html | CVE | Broken LinkVendor Advisory |
| https://github.com/peerigon/angular-expressions/commit/07edb62902b1f6127b3dcc013da61c6316dd0bf1 | CVE | PatchThird Party Advisory |
| https://github.com/peerigon/angular-expressions/security/advisories/GHSA-j6px-jwvv-vpwq | CVE | Vendor Advisory |
| https://www.npmjs.com/package/angular-expressions | CVE | Product |
| http://blog.angularjs.org/2016/09/angular-16-expression-sandbox-removal.html | [email protected] | Broken LinkVendor Advisory |
| https://github.com/peerigon/angular-expressions/commit/07edb62902b1f6127b3dcc013da61c6316dd0bf1 | [email protected] | PatchThird Party Advisory |
| https://github.com/peerigon/angular-expressions/security/advisories/GHSA-j6px-jwvv-vpwq | [email protected] | Vendor Advisory |
| https://www.npmjs.com/package/angular-expressions | [email protected] | Product |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-94 | Improper Control of Generation of Code ('Code Injection') | [email protected] |
| CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| peerigon angular-expressions | < 1.1.2 |
CPE
Remediation
| |
Change History
6 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Nov 21, 2024 | CVE Modified | CVE |
| May 14, 2024 | CVE Modified | [email protected] |
| Oct 19, 2022 | Reanalysis | [email protected] |
| Feb 8, 2021 | Initial Analysis | [email protected] |
| Feb 1, 2021 | CVE Modified | [email protected] |