QID 982961

QID 982961: Nodejs (npm) Security Update for angular-expressions (GHSA-j6px-jwvv-vpwq)

Security update has been released for angular-expressions to fix the vulnerability.

Note: The preceding description block is extracted directly from the security advisory. Using automation, we have attempted to clean and format it as much as possible without introducing additional issues.

The vulnerability, reported by GoSecure Inc, allows Remote Code Execution, if you call `expressions.compile(userControlledInput)` where `userControlledInput` is text that comes from user input.

This time, 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.

  • CVSS V3 rated as Critical - 8.8 severity.
  • CVSS V2 rated as High - 6.5 severity.
  • Solution
    Users should upgrade to version 1.1.2 of angular-expressionsWorkaround:
    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 :

    ```js
    if (/^[|a-zA-Z.0-9 :"'+-?]+$/.test(userControlledInput)) {
    var result = expressions.compile(userControlledInput);
    }
    else {
    result = undefined;
    }
    ```
    Vendor References

    CVEs related to QID 982961

    Software Advisories
    Advisory ID Software Component Link
    GHSA-j6px-jwvv-vpwq angular-expressions URL Logo github.com/advisories/GHSA-j6px-jwvv-vpwq