CVE-2020-5219: Remote Code Execution in Angular Expressions
Summary
CVE-2020-5219: Remote Code Execution in Angular Expressions. Affects angular-expressions versions < 1.0.1. Fixed in 1.0.1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Angular Expressions is an open-source library that provides a way to evaluate and execute AngularJS expressions. It is commonly used in web applications to dynamically evaluate user input or perform calculations. However, a vulnerability has been discovered in Angular Expressions that allows for remote code execution. This vulnerability can be exploited if the application calls expressions.compile(userControlledInput) with user-controlled input. Depending on the environment (browser or server), an attacker can execute arbitrary browser scripts or JavaScript expressions, leading to potential remote code execution.
Vulnerability Detail
The vulnerability in Angular Expressions, reported by GoSecure Inc, allows for remote code execution when user-controlled input is passed to the expressions.compile() function. In a browser environment, this can result in the execution of arbitrary browser scripts. In a server environment, an attacker can run any JavaScript expression, gaining remote code execution capabilities. This vulnerability poses a significant risk to the security and integrity of affected applications.
How To Fix
Minimum fixed version
1.0.1
This is the first release that contains the fix.
npm install angular-expressions@1.0.1
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
A temporary workaround for this vulnerability is to either disable user-controlled input that is passed to angular-expressions in the application or apply input validation to restrict the allowed characters. The following code snippet demonstrates an example of input validation:
if (/^[|a-zA-Z.0-9 :"'+-?]+$/.test(userControlledInput)) {
var result = expressions.compile(userControlledInput);
} else {
result = undefined;
}
Conclusion
The remote code execution vulnerability in Angular Expressions (CVE-2020-5219) poses a significant risk to applications that use this library. It is crucial to upgrade to version 1.0.1 or apply the provided workaround to mitigate the risk of exploitation. For further support and assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for angular-expressions →
FAQ
The impact of this vulnerability is remote code execution. Depending on the environment, an attacker can execute arbitrary browser scripts or JavaScript expressions, potentially compromising the security and integrity of the application.
To fix this vulnerability, upgrade to version 1.0.1 of angular-expressions. This version includes a patch that addresses the remote code execution issue.
Yes, a temporary workaround is to either disable user-controlled input that is passed to angular-expressions or apply input validation to restrict the allowed characters.
Yes, this vulnerability can be exploited remotely if the application allows user-controlled input to be passed to angular-expressions.
This vulnerability was reported by Maxime Nadeau from GoSecure, Inc.
References
Related vulnerabilities
Recent vulnerabilities recorded for angular-expressions.