Lucene search

K
nodejsAnonymousNODEJS:1618
HistoryFeb 23, 2021 - 2:02 a.m.

Remote Code Execution

2021-02-2302:02:11
Anonymous
www.npmjs.com
55

0.009 Low

EPSS

Percentile

82.9%

Overview

Affected versions of angular-expressions are affected by a remote code execution vulnerability.

Impact

If you call expressions.compile(userControlledInput) where userControlledInput is text that comes from user input you are potentially impacted.

The security of the package could be bypassed by using a more complex payload, using a .constructor.constructor technique.

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

Workarounds

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 :
if (/^[|a-zA-Z.0-9 :"'+-?]+$/.test(userControlledInput)) {
      var result = expressions.compile(userControlledInput);
}
else {
     result = undefined;
}

Recommendation

Upgrade to version 1.1.2 or later.

References

CPENameOperatorVersion
angular-expressionslt1.1.2

0.009 Low

EPSS

Percentile

82.9%