CVE-2024-29025
Netty's HttpPostRequestDecoder can OOM
Description
Summary
The HttpPostRequestDecoder can be tricked to accumulate data. I have spotted currently two attack vectors
Details
- While the decoder can store items on the disk if configured so, there are no limits to the number of fields the form can have, an attacher can send a chunked post consisting of many small fields that will be accumulated in the
bodyListHttpDatalist. - The decoder cumulates bytes in the
undecodedChunkbuffer until it can decode a field, this field can cumulate data without limits
PoC
Here is a Netty branch that provides a fix + tests : https://github.com/vietj/netty/tree/post-request-decoder
Here is a reproducer with Vert.x (which uses this decoder) https://gist.github.com/vietj/f558b8ea81ec6505f1e9a6ca283c9ae3
Impact
Any Netty based HTTP server that uses the HttpPostRequestDecoder to decode a form.
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| io.netty » netty-codec-http | < 4.1.108.Final | 4.1.108.Final |
Blast radius
61% of the dependent artifacts (19,799) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 37,802 |
| 2 hops | 228,915 |
| 3 hops | 425,239 |
| 4 hops | 329,616 |
| 5 hops | 214,773 |
| 6 hops | 121,287 |
Most used dependents
- org.testcontainers » testcontainers4,109 usages
- io.netty » netty-all3,584 usages
- org.apache.hadoop » hadoop-common3,482 usages
- org.apache.spark » spark-sql3,174 usages
- redis.clients » jedis2,971 usages
- org.apache.spark » spark-core2,899 usages
- org.springframework.boot » spring-boot-starter-webflux2,764 usages
- com.android.tools.build » gradle2,197 usages
- io.vertx » vertx-core2,116 usages
- org.seleniumhq.selenium » selenium-java2,089 usages
- org.apache.zookeeper » zookeeper2,044 usages
- com.typesafe.play » play-test1,902 usages
- org.apache.hadoop » hadoop-client1,796 usages
- io.quarkus » quarkus-maven-plugin1,484 usages
- org.apache.kafka » kafka1,450 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
- Webhttps://github.com/netty/netty/security/advisories/GHSA-5jpm-x58v-624v
- Advisoryhttps://nvd.nist.gov/vuln/detail/CVE-2024-29025
- Webhttps://github.com/netty/netty/commit/0d0c6ed782d13d423586ad0c71737b2c7d02058c
- Webhttps://gist.github.com/vietj/f558b8ea81ec6505f1e9a6ca283c9ae3
- Packagehttps://github.com/netty/netty
- Webhttps://github.com/vietj/netty/tree/post-request-decoder
- Webhttps://lists.debian.org/debian-lts-announce/2024/06/msg00015.html
