CVE-2021-21277 Angular Expressions - Remote Code Execution

High 8.5 Published Updated

Attackers can execute arbitrary code by injecting malicious payloads into user-controlled input processed by the angular-expressions library.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-21277?

CVE-2021-21277 is a high-severity code injection vulnerability in peerigon angular-expressions, published on 1 Feb 2021. Any signed-in user can exploit it over the network, with no action from the victim.

Official 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.

Weakness: CWE-94, CWE-74

Which versions are affected by CVE-2021-21277?

2 open source packages ship an affected version, including angular-expressions. It affects 1 product.

PackageAffectedFixed in
angular-expressions npmAll versions1.1.2
angular-expressions npmAll versions1.1.2

Products include Peerigon Angular-Expressions.

How do I fix CVE-2021-21277?

Upgrade angular-expressions to 1.1.2 or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2021-21277 being exploited?

There is no known exploitation of CVE-2021-21277 in the wild and no public exploit code.

Sources

Also known as GHSA-j6px-jwvv-vpwq.

Is CVE-2021-21277 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free