CVE-2024-29025: Netty codec http Netty's HttpPostRequestDecoder Can OOM Vulnerability

MODERATE
Advisory Identifier: GHSA-5jpm-x58v-624v
CVSS 5.3
CWE-770
Published
Advisory Summary

CVE-2024-29025 is a MODERATE (CVSS 5.3) netty's httppostrequestdecoder can oom vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Netty codec http libraries in the Maven ecosystem. The issue involves netty's httppostrequestdecoder can oom. Remediation is available by upgrading affected packages to version 4.1.108.Final.

CVE-2024-29025 at a Glance

CVE Identifier CVE-2024-29025
GHSA Identifier GHSA-5jpm-x58v-624v
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product Netty codec http
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2024-29025

To remediate this vulnerability, upgrade all affected Netty codec http dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

io.netty:netty-codec-http fixed: 4.1.108.Final
<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-codec-http</artifactId>
    <version>4.1.108.Final</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=io.netty

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2024-29025, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=io.netty

Analyze the terminal output to locate any version of Netty codec http in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.1.108.Final), your application is affected.

Note: The mvn dependency:tree -Dincludes=io.netty command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In Netty codec http, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary The `HttpPostRequestDecoder` can be tricked to accumulate data. I have spotted currently two attack vectors ### Details 1. 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 `bodyListHttpData` list. 2. The decoder cumulates bytes in the `undecodedChunk` buffer 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.

CVE-2024-29025 Affected Netty codec http Versions

1 component(s)
Fixed Versions:
4.1.108.Final
Product / Package Ecosystem Affected Versions Fixed Version
io.netty:netty-codec-http
Maven
< 4.1.108.Final
4.1.108.Final

References

Frequently Asked Questions

What is CVE-2024-29025?
CVE-2024-29025 is a security vulnerability in Netty codec http involving Netty's HttpPostRequestDecoder can OOM under CWE-770: Allocation of Resources Without Limits or Throttling.
Which Netty codec http versions are affected?
Affected versions include releases prior to 4.1.108.Final across affected packages: io.netty:netty-codec-http.
What version fixes CVE-2024-29025?
Upgrading to 4.1.108.Final (or the latest patched release for your respective branch) resolves the vulnerability.
Is netty-codec-http affected?
Yes, io.netty:netty-codec-http is affected in releases prior to 4.1.108.Final. Upgrade your dependency to 4.1.108.Final or later.
What is the CVSS score of CVE-2024-29025?
CVE-2024-29025 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2024-29025?
CVE-2024-29025 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check Maven dependencies for CVE-2024-29025?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=io.netty'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-5jpm-x58v-624v",
  "modified" : "2024-06-22T00:30:55Z",
  "published" : "2024-03-25T19:40:50Z",
  "aliases" : [ "CVE-2024-29025" ],
  "summary" : "Netty's HttpPostRequestDecoder can OOM",
  "details" : "### Summary\nThe `HttpPostRequestDecoder` can be tricked to accumulate data. I have spotted currently two attack vectors \n\n### Details\n1. 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 `bodyListHttpData` list.\n2. The decoder cumulates bytes in the `undecodedChunk` buffer until it can decode a field, this field can cumulate data without limits\n\n### PoC\n\nHere is a Netty branch that provides a fix + tests : https://github.com/vietj/netty/tree/post-request-decoder\n\n\nHere is a reproducer with Vert.x (which uses this decoder) https://gist.github.com/vietj/f558b8ea81ec6505f1e9a6ca283c9ae3\n\n### Impact\nAny Netty based HTTP server that uses the `HttpPostRequestDecoder` to decode a form.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.netty:netty-codec-http"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.1.108.Final"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/netty/netty/security/advisories/GHSA-5jpm-x58v-624v"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-29025"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/netty/netty/commit/0d0c6ed782d13d423586ad0c71737b2c7d02058c"
  }, {
    "type" : "WEB",
    "url" : "https://gist.github.com/vietj/f558b8ea81ec6505f1e9a6ca283c9ae3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/netty/netty"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vietj/netty/tree/post-request-decoder"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2024/06/msg00015.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-03-25T19:40:50Z",
    "nvd_published_at" : "2024-03-25T20:15:08Z"
  }
}