CVE-2022-31781 Regular Expression Denial of Service (ReDoS) in ContentType.java. (GHSL-2022-022)
Attackers can cause denial of service via catastrophic backtracking in ContentType parsing if external input reaches the constructor.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-31781?
CVE-2022-31781 is a high-severity denial of service vulnerability in Apache Tapestry, published on 13 Jul 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Apache Tapestry up to version 5.8.1 is vulnerable to Regular Expression Denial of Service (ReDoS) in the way it handles Content Types. Specially crafted Content Types may cause catastrophic backtracking, taking exponential time to complete. Specifically, this is about the regular expression used on the parameter of the org.apache.tapestry5.http.ContentType class. Apache Tapestry 5.8.2 has a fix for this vulnerability. Notice the vulnerability cannot be triggered by web requests in Tapestry code alone. It would only happen if there's some non-Tapestry codepath passing some outside input to the ContentType class constructor.
Weakness: CWE-1333
Which versions are affected by CVE-2022-31781?
2 open source packages ship an affected version, including org.apache.tapestry:tapestry-core. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
org.apache.tapestry:tapestry-core Maven | All versions | 5.8.2 |
org.apache.tapestry:tapestry-core Maven | All versions | 5.8.2 |
Products include Apache Tapestry.
How do I fix CVE-2022-31781?
Upgrade org.apache.tapestry:tapestry-core to 5.8.2 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2022-31781 being exploited?
There is no known exploitation of CVE-2022-31781 in the wild and no public exploit code.
Other vulnerabilities in Apache Tapestry
- CVE-2022-46366 Apache Tapestry prior to version 4 (EOL) allows RCE though deserialization of untrusted input
- CVE-2021-27850 Bypass of the fix for CVE-2019-0195
- CVE-2020-17531 Deserialization flaw in EOL Tapestry 4.
- CVE-2019-0195 Deserialization of Untrusted Data in Apache Tapestry
- CVE-2019-10071 Timing attack on HMAC signature comparison in Apache Tapestry
Sources
Also known as GHSA-227g-7cvv-6ff3.