CVE-2022-25844

ReDoS Vulnerability
Affects
AngularJS
>=1.7.0
in
AngularJS
No items found.
Exclamation circle icon
Patch Available
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs

Overview

AngularJS is a JavaScript framework for developing dynamic web applications. It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly.

A Regular expression Denial of Service (ReDoS) vulnerability (CVE-2022-25844) has been identified in AngularJS, which could allow attackers to provide a large, carefully-crafted input that causes a Denial of Service of the application.

Per OWASP: The Regular expression Denial of Service (ReDoS) is a Denial of Service attack that exploits the fact that most Regular Expression implementations may reach extreme situations that cause them to work very slowly (exponentially related to input size). An attacker can then cause a program using a Regular Expression (Regex) to enter these extreme situations and then hang for a very long time.

This issue affects AngularJS versions 1.7.0 and greater.

Details

Module Info

Vulnerability Info

This Medium-severity vulnerability is found in the main angular package in AngularJS versions 1.7.0 and greater.

AngularJS' localization utilities allow formatting numbers as currency values. If an application sets the current locale's NUMBER_FORMATS.PATTERNS[1].posPre value to a user-defined string, it can be abused to cause a Denial of Service of the appication.

Steps to Reproduce

  • Create an AngularJS application and set the $locale's prePos value to a string consisting of many spaces:
angular .module('app', []) .run(['$locale', $locale => { $locale.NUMBER_FORMATS.PATTERNS[1].posPre = ' '.repeat(1000000); }]);

    • Run the currency filter on a value with the empty string as the currency symbol. This can be done either in a template (with {{ 100 | currency : '' }}) or by calling the filter directly:
    angular .module('app') .run(['currencyFilter', currencyFilter => { currencyFilter(100, ''); }]);

    Proof of Concept

    A full reproduction with code similar to the above can be found here:
    currency filter ReDoS POC

    Mitigation

    The AngularJS project is End-of-Life and will not receive any updates to address this issue. For more information see here.

    Users of the affected components should apply one of the following mitigations:

    • Migrate affected applications away from AngularJS.
    • Leverage a commercial support partner like HeroDevs for post-EOL security support.
    Vulnerability Details
    ID
    CVE-2022-25844
    PROJECT Affected
    AngularJS
    Versions Affected
    >=1.7.0
    Published date
    May 1, 2022
    ≈ Fix date
    April 1, 2022
    Severity
    Medium
    Category
    ReDoS Vulnerability
    Sign up for the latest vulnerability alerts fixed in
    AngularJS NES
    Rss feed icon
    Subscribe via RSS
    or
    Thanks for signing up for our Newsletter! We look forward to connecting with you.
    Oops! Something went wrong while submitting the form.