CVE-2022-31781
Java vulnerability analysis and mitigation

Overview

Apache Tapestry versions up to 5.8.1 were found to contain a Regular Expression Denial of Service (ReDoS) vulnerability in the way it handles Content Types. The vulnerability was discovered by the CodeQL team and was assigned CVE-2022-31781. The issue was initially reported on April 7, 2022, and was fixed with the release of version 5.8.2 on June 20, 2022 (GitHub Security Lab).

Technical details

The vulnerability exists in the ContentType.java class where a regular expression pattern ^(.+)/([^;]+)(;(.+=[^;]+))*$ is used to match Content Type headers. The issue specifically involves nested repetition at (;(.+=[^;]+))*, which can cause exponential backtracking in the regex engine when attempting to distinguish matching parts of the expression. This vulnerability is particularly impactful when running on JDK versions 8 or lower, as JDK 9 introduced mitigations for this type of issue (GitHub Security Lab).

Impact

The exploitation of this vulnerability could lead to a denial of service through resource consumption. However, it's important to note that the vulnerability cannot be triggered by web requests in Tapestry code alone and would only occur if there's some non-Tapestry codepath passing outside input to the ContentType class constructor (Openwall).

Mitigation and workarounds

The vulnerability has been fixed in Apache Tapestry version 5.8.2, released on June 20, 2022. Users are advised to upgrade to this version or later to address the issue. Additionally, running the application on JDK 9 or later provides built-in mitigations for this type of ReDoS vulnerability (GitHub Security Lab).

Additional resources


SourceThis report was generated using AI

Related Java vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-65091CRITICAL10
  • JavaJava
  • org.xwiki.contrib:macro-fullcalendar-pom
NoYesJan 10, 2026
CVE-2025-70974CRITICAL10
  • JavaJava
  • com.alibaba:fastjson
NoYesJan 09, 2026
CVE-2026-22244HIGH8.5
  • JavaJava
  • org.open-metadata:platform
NoYesJan 08, 2026
CVE-2025-65090MEDIUM5.3
  • JavaJava
  • org.xwiki.contrib:macro-fullcalendar-pom
NoYesJan 10, 2026
CVE-2026-0707MEDIUM5.3
  • JavaJava
  • org.keycloak:keycloak-parent
NoNoJan 08, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management