CVE-2024-36121: Netty incubator codec ohttp BoringSSLAEADContext Vulnerability

MODERATE
Advisory Identifier: GHSA-g762-h86w-8749
CVSS 5.9
CWE-190 CWE-200
Published
Advisory Summary

CVE-2024-36121 is a MODERATE (CVSS 5.9) boringsslaeadcontext vulnerability (CWE-190: Integer Overflow or Wraparound) affecting Netty incubator codec ohttp libraries in the Maven ecosystem. The issue involves boringsslaeadcontext in netty repeats nonces. Remediation is available by upgrading affected packages to version 0.0.11.Final.

CVE-2024-36121 at a Glance

CVE Identifier CVE-2024-36121
GHSA Identifier GHSA-g762-h86w-8749
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-190: Integer Overflow or Wraparound
Affected Product Netty incubator codec ohttp
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.9

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

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

How to Fix CVE-2024-36121

To remediate this vulnerability, upgrade all affected Netty incubator codec ohttp 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.incubator:netty-incubator-codec-ohttp fixed: 0.0.11.Final
<dependency>
    <groupId>io.netty.incubator</groupId>
    <artifactId>netty-incubator-codec-ohttp</artifactId>
    <version>0.0.11.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.incubator

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=io.netty.incubator

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

Note: The mvn dependency:tree -Dincludes=io.netty.incubator 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-190: Integer Overflow or Wraparound, where the product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. this occurs when an integer value is incremented to a value that is too large to store in the associated representation. when this occurs, the value may become a very small or negative number. In Netty incubator codec ohttp, 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 BoringSSLAEADContext keeps track of how many OHTTP responses have been sent and uses this sequence number to calculate the appropriate nonce to use with the encryption algorithm. Unfortunately, two separate errors combine which would allow an attacker to cause the sequence number to overflow and thus the nonce to repeat. ### Details 1. There is no overflow detection or enforcement of the maximum sequence value. (This is a missed requirement from the draft Chunked Oblivious OHTTP RFC and so should be inherited from the HPKE RFC 9180, Section 5.2). 2. The sequence number (seq) is stored as 32-bit int which is relatively easy to overflow. https://github.com/netty/netty-incubator-codec-ohttp/blob/1ddadb6473cd3be5491d114431ed4c1a9f316001/codec-ohttp-hpke-classes-boringssl/src/main/java/io/netty/incubator/codec/hpke/boringssl/BoringSSLAEADContext.java#L112-L114 ### Impact If the BoringSSLAEADContext is used to encrypt more than 2^32 messages then the AES-GCM nonce will repeat. Repeating a nonce with AES-GCM results in both confidentiality and integrity compromise of data encrypted with the associated key.

CVE-2024-36121 Affected Netty incubator codec ohttp Versions

1 component(s)
Fixed Versions:
0.0.11.Final
Product / Package Ecosystem Affected Versions Fixed Version
io.netty.incubator:netty-incubator-codec-ohttp
Maven
≥ 0.0.3.Final
< 0.0.11.Final
0.0.11.Final

References

Frequently Asked Questions

What is CVE-2024-36121?
CVE-2024-36121 is a security vulnerability in Netty incubator codec ohttp involving BoringSSLAEADContext in Netty Repeats Nonces under CWE-190: Integer Overflow or Wraparound.
Which Netty incubator codec ohttp versions are affected?
Affected versions include releases prior to 0.0.11.Final across affected packages: io.netty.incubator:netty-incubator-codec-ohttp.
What version fixes CVE-2024-36121?
Upgrading to 0.0.11.Final (or the latest patched release for your respective branch) resolves the vulnerability.
Is netty-incubator-codec-ohttp affected?
Yes, io.netty.incubator:netty-incubator-codec-ohttp is affected in releases prior to 0.0.11.Final. Upgrade your dependency to 0.0.11.Final or later.
What is the CVSS score of CVE-2024-36121?
CVE-2024-36121 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:H/A:N.
What CWE is associated with CVE-2024-36121?
CVE-2024-36121 is classified under CWE-190: Integer Overflow or Wraparound (The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.).
How can I check Maven dependencies for CVE-2024-36121?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=io.netty.incubator'. 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-g762-h86w-8749",
  "modified" : "2024-06-05T16:53:49Z",
  "published" : "2024-06-05T16:53:49Z",
  "aliases" : [ "CVE-2024-36121" ],
  "summary" : "BoringSSLAEADContext in Netty Repeats Nonces",
  "details" : "### Summary\nBoringSSLAEADContext keeps track of how many OHTTP responses have been sent and uses this sequence number to calculate the appropriate nonce to use with the encryption algorithm. \nUnfortunately, two separate errors combine which would allow an attacker to cause the sequence number to overflow and thus the nonce to repeat.\n\n### Details\n1. There is no overflow detection or enforcement of the maximum sequence value. (This is a missed requirement from the draft Chunked Oblivious OHTTP RFC and so should be inherited from the HPKE RFC 9180, Section 5.2).\n2. The sequence number (seq) is stored as 32-bit int which is relatively easy to overflow.\n\nhttps://github.com/netty/netty-incubator-codec-ohttp/blob/1ddadb6473cd3be5491d114431ed4c1a9f316001/codec-ohttp-hpke-classes-boringssl/src/main/java/io/netty/incubator/codec/hpke/boringssl/BoringSSLAEADContext.java#L112-L114\n\n### Impact\nIf the BoringSSLAEADContext is used to encrypt more than 2^32 messages then the AES-GCM nonce will repeat.\nRepeating a nonce with AES-GCM results in both confidentiality and integrity compromise of data encrypted with the associated key.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.netty.incubator:netty-incubator-codec-ohttp"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.0.3.Final"
      }, {
        "fixed" : "0.0.11.Final"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/netty/netty-incubator-codec-ohttp/security/advisories/GHSA-g762-h86w-8749"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-36121"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/netty/netty-incubator-codec-ohttp"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/netty/netty-incubator-codec-ohttp/blob/1ddadb6473cd3be5491d114431ed4c1a9f316001/codec-ohttp-hpke-classes-boringssl/src/main/java/io/netty/incubator/codec/hpke/boringssl/BoringSSLAEADContext.java#L112-L114"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-190", "CWE-200" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-06-05T16:53:49Z",
    "nvd_published_at" : "2024-06-04T22:15:10Z"
  }
}