# CVE-2022-2053: Undertow vulnerable to Dos via Large AJP request

> An attacker can cause a denial of service by sending oversized POST requests via AJP, triggering connection closures that mark backend workers as errors.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 5 Aug 2022
- **Updated:** 3 Aug 2024
- **Also known as:** DEBIAN-CVE-2022-2053, GHSA-95rf-557x-44g5, UBUNTU-CVE-2022-2053

## What is CVE-2022-2053?

CVE-2022-2053 is a high-severity denial of service vulnerability in Undertow, published on 5 Aug 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

When a POST request comes through AJP and the request exceeds the max-post-size limit (maxEntitySize), Undertow's AjpServerRequestConduit implementation closes a connection without sending any response to the client/proxy. This behavior results in that a front-end proxy marking the backend worker (application server) as an error state and not forward requests to the worker for a while. In mod_cluster, this continues until the next STATUS request (10 seconds intervals) from the application server updates the server state. So, in the worst case, it can result in "All workers are in error state" and mod_cluster responds "503 Service Unavailable" for a while (up to 10 seconds). In mod_proxy_balancer, it does not forward requests to the worker until the "retry" timeout passes. However, luckily, mod_proxy_balancer has "forcerecovery" setting (On by default; this parameter can force the immediate recovery of all workers without considering the retry parameter of the workers if all workers of a balancer are in error state.). So, unlike mod_cluster, mod_proxy_balancer does not result in responding "503 Service Unavailable". An attacker could use this behavior to send a malicious request and trigger server errors, resulting in DoS (denial of service). This flaw was fixed in Undertow 2.2.19.Final, Undertow 2.3.0.Alpha2.

Weakness: CWE-400 (Uncontrolled Resource Consumption)

## Which versions are affected by CVE-2022-2053?

4 open source packages ship an affected version, including io.undertow:undertow-core. It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `io.undertow:undertow-core` | Maven | All versions | 2.2.19.Final |
| `io.undertow:undertow-core` | Maven | All versions | 2.2.19.Final |
| `io.undertow:undertow-core` | Maven | From 2.3.0.Alpha1 | 2.3.0.Alpha2 |
| `io.undertow:undertow-core` | Maven | From 2.3.0.Alpha1 | 2.3.0.Alpha2 |

Products: Redhat Integration Camel K, Redhat Jboss Fuse, Redhat Undertow.

## How do I fix CVE-2022-2053?

Upgrade io.undertow:undertow-core to a fixed version for your release line: 2.2.19.Final or 2.3.0.Alpha2.

## Is CVE-2022-2053 being exploited?

There is no known exploitation of CVE-2022-2053 in the wild and no public exploit code.

## Other vulnerabilities in Undertow

- [CVE-2022-0084](https://insights.sbomify.com/CVE-2022-0084/): XNIO `notifyReadClosed` method logging message to unexpected end (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-2053 and fix it if it is affected.

What it is: CVE-2022-2053 is a high-severity denial of service vulnerability in Undertow, published on 5 Aug 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-2053 in the wild and no public exploit code.

Affected packages and fixed versions:
- io.undertow:undertow-core (Maven): affected all versions; fixed in 2.2.19.Final
- io.undertow:undertow-core (Maven): affected all versions; fixed in 2.2.19.Final
- io.undertow:undertow-core (Maven): affected from 2.3.0.Alpha1; fixed in 2.3.0.Alpha2
- io.undertow:undertow-core (Maven): affected from 2.3.0.Alpha1; fixed in 2.3.0.Alpha2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-2053/ (Markdown: https://insights.sbomify.com/CVE-2022-2053/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-2053
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-2053
- OSV: https://osv.dev/vulnerability/CVE-2022-2053

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-2053/
Summaries are generated and may contain mistakes; the official description above is the record.
