# CVE-2022-31781: Regular Expression Denial of Service (ReDoS) in ContentType.java. (GHSL-2022-022)

- Severity: High 7.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.97%, higher than 81% of CVEs (2026-12-01)
- Published: 2022-07-13T07:25:10.000Z
- Modified: 2026-06-17T04:46:17.887Z
- Also known as: GHSA-227g-7cvv-6ff3
- Weaknesses: CWE-400, CWE-1333
- Assigned by: apache

## 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.

(As written by CVE List.)

## Affected

- Apache Software Foundation Apache Tapestry: from 5.8.1 before 5.8.1
- org.apache.tapestry:tapestry-core (Maven): before 5.8.2
- apache tapestry: before 5.8.2

## Every score

- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://www.openwall.com/lists/oss-security/2022/07/12/3> (mailing-list, vendor-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-31781> (advisory)
- <https://github.com/apache/tapestry-5/commit/3c8d6103832eec3bc06029dd2532f06df717431f> (web)

## Sources

- CVE List: [CVE-2022-31781](https://www.cve.org/CVERecord?id=CVE-2022-31781), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-227g-7cvv-6ff3](https://github.com/advisories/GHSA-227g-7cvv-6ff3), CC-BY-4.0, modified 2024-02-16
- NVD: [CVE-2022-31781](https://nvd.nist.gov/vuln/detail/CVE-2022-31781), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-31781 · Whole record: https://cve.day/CVE-2022-31781.json · Rebuilt by cve.day 2026-11-25T22:58:12.923Z
