CVE-2022-26650: Regular expression denial of service in Apache ShenYu
Summary
CVE-2022-26650: Regular expression denial of service in Apache ShenYu. Affects org.apache.shenyu:shenyu versions >= 2.4.0, < 2.4.3. Fixed in 2.4.3. 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
Apache ShenYu is an open-source project that provides a lightweight, high-performance, and scalable API gateway. It is designed to handle a large number of requests and provide various functionalities such as routing, load balancing, and security. The vulnerability identified as CVE-2022-26650 affects Apache ShenYu versions 2.4.0, 2.4.1, and 2.4.2. This vulnerability can be exploited by an attacker to cause a denial of service (DoS) by sending malicious regular expressions and characters, leading to resource exhaustion.
Vulnerability Detail
The vulnerability in Apache ShenYu lies in the RegexPredicateJudge.java file, specifically in the usage of the Pattern.matches() method. This method is used to evaluate a condition provided by the user against real data. Both the condition and real data are user-controllable inputs, making them susceptible to manipulation. By crafting malicious regular expressions and characters, an attacker can cause the application to consume excessive resources, resulting in a DoS condition. This vulnerability is considered high severity with a CVSS score of 7.5.
How To Fix
Minimum fixed version
2.4.3
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, users can implement input validation and sanitization mechanisms to filter out potentially malicious regular expressions and characters. This can be done by using appropriate regular expression libraries or custom validation logic. However, applying the fix by upgrading to the latest version is the recommended approach.
Conclusion
The vulnerability in Apache ShenYu (CVE-2022-26650) allows an attacker to cause a denial of service by exploiting resource exhaustion through malicious regular expressions and characters. It is crucial to upgrade to Apache ShenYu version 2.4.3 or later to mitigate this vulnerability. Implementing input validation and sanitization mechanisms can serve as a temporary workaround. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for org.apache.shenyu:shenyu →
FAQ
Apache ShenYu is an open-source API gateway that provides routing, load balancing, and security functionalities.
This vulnerability allows an attacker to cause a denial of service by exploiting the application's resource exhaustion through malicious regular expressions and characters.
Versions 2.4.0, 2.4.1, and 2.4.2 of Apache ShenYu are affected by this vulnerability.
To fix this vulnerability, it is recommended to upgrade to Apache ShenYu version 2.4.3 or later.
As a temporary workaround, users can implement input validation and sanitization mechanisms to filter out potentially malicious regular expressions and characters.