CVE-2026-61798: netty-incubator-codec-ohttp BoringSSL HPKE Private Key Bytes Vulnerability

HIGH
Advisory Identifier: GHSA-2mc4-j865-9q4r
CVSS 8.1
CWE-312 CWE-532 CWE-200
Published
Advisory Summary

CVE-2026-61798 is a HIGH (CVSS 8.1) boringssl hpke private key bytes vulnerability (CWE-312: Cleartext Storage of Sensitive Information) affecting netty-incubator-codec-ohttp libraries in the Maven ecosystem. The issue involves boringssl hpke private key bytes exposed through tostring() and exception messages. Remediation is available by upgrading affected packages to version 0.0.23.Final.

CVE-2026-61798 at a Glance

CVE Identifier CVE-2026-61798
GHSA Identifier GHSA-2mc4-j865-9q4r
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-312: Cleartext Storage of Sensitive Information
Affected Product netty-incubator-codec-ohttp
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 8.1

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

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

How to Fix CVE-2026-61798

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-hpke-classes-boringssl fixed: 0.0.23.Final
<dependency>
    <groupId>io.netty.incubator</groupId>
    <artifactId>netty-incubator-codec-ohttp-hpke-classes-boringssl</artifactId>
    <version>0.0.23.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-2026-61798, 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.23.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-312: Cleartext Storage of Sensitive Information, where the product stores sensitive information in cleartext within a resource that might be accessible to another control sphere. 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 `io.netty.incubator:netty-incubator-codec-ohttp-hpke-classes-boringssl` exposes raw HPKE private key bytes in string representations and error messages. `BoringSSLAsymmetricCipherKeyPair.toString()` includes the private-key parameter object, and `BoringSSLAsymmetricKeyParameter.toString()` renders the full byte array with `Arrays.toString(bytes)`. Separately, failed native key initialization includes `Arrays.toString(privateKeyBytes)` in the thrown `IllegalArgumentException` message. Applications that log key-pair objects or exceptions can persist private key material in logs. ## Details `codec-ohttp-hpke-classes-boringssl/src/main/java/io/netty/incubator/codec/hpke/boringssl/BoringSSLAsymmetricCipherKeyPair.java` renders private key material through `toString()`: - `BoringSSLAsymmetricCipherKeyPair.toString()` at lines 72-78 concatenates `"privateKey=" + privateKey`. - `privateKey` is a `BoringSSLAsymmetricKeyParameter` created with `isPrivate=true` at lines 26-36. `codec-ohttp-hpke-classes-boringssl/src/main/java/io/netty/incubator/codec/hpke/boringssl/BoringSSLAsymmetricKeyParameter.java` then renders all bytes: - `BoringSSLAsymmetricKeyParameter.toString()` at lines 70-76 returns `"bytes=" + Arrays.toString(bytes)` regardless of whether `isPrivate` is true. A separate error path in `codec-ohttp-hpke-classes-boringssl/src/main/java/io/netty/incubator/codec/hpke/boringssl/BoringSSL.java` also exposes caller-provided private key bytes: - `EVP_HPKE_KEY_init_or_throw(...)` at lines 228-232 throws `IllegalArgumentException("privateKeyBytes does not contain a valid private key: " + Arrays.toString(privateKeyBytes))` when BoringSSL rejects the key. Because Java logging frameworks commonly call `toString()` for structured objects and commonly persist exception messages, these paths can place complete HPKE private key material in logs or telemetry. ## Proof of concept Safe local verification was performed without native BoringSSL by compiling the relevant Java classes and a no-op native stub for the unused finalizer reference. The observed output includes the full private key byte array: ```text BoringSSLAsymmetricCipherKeyPair{privateKey=BoringSSLAsymmetricKeyParameter{bytes=[1, 2, 3, 4], isPrivate=true}, publicKey=BoringSSLAsymmetricKeyParameter{bytes=[5, 6, 7, 8], isPrivate=false}} ``` Minimal reproducer concept in the same package: ```java package io.netty.incubator.codec.hpke.boringssl; public final class VerifyPrivateKeyToString { public static void main(String[] args) { byte[] privateKey = new byte[] {1, 2, 3, 4}; byte[] publicKey = new byte[] {5, 6, 7, 8}; BoringSSLAsymmetricCipherKeyPair pair = new BoringSSLAsymmetricCipherKeyPair(privateKey, publicKey); System.out.println(pair.toString()); } } ``` The code path is deterministic: the production `toString()` methods concatenate the raw private-key byte array. ## Impact If an affected key pair or initialization exception is logged, application logs contain complete HPKE private key material. Anyone with access to those logs can recover the key. Depending on key reuse and log retention, this can compromise: - confidentiality of OHTTP messages encrypted to the exposed key; - integrity/authenticity expectations for future messages if the key remains active; - incident response and key rotation assumptions, because logs may retain key material long after the in-memory key is rotated. ## Suggested remediation - Redact private key material in `BoringSSLAsymmetricKeyParameter.toString()` when `isPrivate` is true, for example `bytes=<redacted>` or only key type/length. - Redact `privateKey` in `BoringSSLAsymmetricCipherKeyPair.toString()`. - Remove `Arrays.toString(privateKeyBytes)` from `BoringSSL.EVP_HPKE_KEY_init_or_throw(...)`; report only length and KEM metadata. - Add regression tests asserting that `toString()` and exception messages do not contain private key byte values. - Consider making key pair classes avoid implementing detailed `toString()` for sensitive material entirely. ## References - `codec-ohttp-hpke-classes-boringssl/src/main/java/io/netty/incubator/codec/hpke/boringssl/BoringSSLAsymmetricCipherKeyPair.java:72-78` - `codec-ohttp-hpke-classes-boringssl/src/main/java/io/netty/incubator/codec/hpke/boringssl/BoringSSLAsymmetricKeyParameter.java:70-76` - `codec-ohttp-hpke-classes-boringssl/src/main/java/io/netty/incubator/codec/hpke/boringssl/BoringSSL.java:228-232`

CVE-2026-61798 Affected netty-incubator-codec-ohttp Versions

1 component(s)
Fixed Versions:
0.0.23.Final
Product / Package Ecosystem Affected Versions Fixed Version
io.netty.incubator:netty-incubator-codec-ohttp-hpke-classes-boringssl
Maven
< 0.0.23.Final
0.0.23.Final

References

Frequently Asked Questions

What is CVE-2026-61798?
CVE-2026-61798 is a security vulnerability in netty-incubator-codec-ohttp involving BoringSSL HPKE private key bytes exposed through toString() and exception messages under CWE-312: Cleartext Storage of Sensitive Information.
Which netty-incubator-codec-ohttp versions are affected?
Affected versions include releases prior to 0.0.23.Final across affected packages: io.netty.incubator:netty-incubator-codec-ohttp-hpke-classes-boringssl.
What version fixes CVE-2026-61798?
Upgrading to 0.0.23.Final (or the latest patched release for your respective branch) resolves the vulnerability.
Is netty-incubator-codec-ohttp-hpke-classes-boringssl affected?
Yes, io.netty.incubator:netty-incubator-codec-ohttp-hpke-classes-boringssl is affected in releases prior to 0.0.23.Final. Upgrade your dependency to 0.0.23.Final or later.
What is the CVSS score of CVE-2026-61798?
CVE-2026-61798 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-61798?
CVE-2026-61798 is classified under CWE-312: Cleartext Storage of Sensitive Information (The product stores sensitive information in cleartext within a resource that might be accessible to another control sphere.).
How can I check Maven dependencies for CVE-2026-61798?
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-2mc4-j865-9q4r",
  "modified" : "2026-08-20T18:43:18Z",
  "published" : "2026-08-20T18:43:17Z",
  "aliases" : [ "CVE-2026-61798" ],
  "summary" : "netty-incubator-codec-ohttp: BoringSSL HPKE private key bytes exposed through toString() and exception messages",
  "details" : "## Summary\n\n`io.netty.incubator:netty-incubator-codec-ohttp-hpke-classes-boringssl` exposes raw HPKE private key bytes in string representations and error messages. `BoringSSLAsymmetricCipherKeyPair.toString()` includes the private-key parameter object, and `BoringSSLAsymmetricKeyParameter.toString()` renders the full byte array with `Arrays.toString(bytes)`. Separately, failed native key initialization includes `Arrays.toString(privateKeyBytes)` in the thrown `IllegalArgumentException` message. Applications that log key-pair objects or exceptions can persist private key material in logs.\n\n## Details\n\n`codec-ohttp-hpke-classes-boringssl/src/main/java/io/netty/incubator/codec/hpke/boringssl/BoringSSLAsymmetricCipherKeyPair.java` renders private key material through `toString()`:\n\n- `BoringSSLAsymmetricCipherKeyPair.toString()` at lines 72-78 concatenates `\"privateKey=\" + privateKey`.\n- `privateKey` is a `BoringSSLAsymmetricKeyParameter` created with `isPrivate=true` at lines 26-36.\n\n`codec-ohttp-hpke-classes-boringssl/src/main/java/io/netty/incubator/codec/hpke/boringssl/BoringSSLAsymmetricKeyParameter.java` then renders all bytes:\n\n- `BoringSSLAsymmetricKeyParameter.toString()` at lines 70-76 returns `\"bytes=\" + Arrays.toString(bytes)` regardless of whether `isPrivate` is true.\n\nA separate error path in `codec-ohttp-hpke-classes-boringssl/src/main/java/io/netty/incubator/codec/hpke/boringssl/BoringSSL.java` also exposes caller-provided private key bytes:\n\n- `EVP_HPKE_KEY_init_or_throw(...)` at lines 228-232 throws `IllegalArgumentException(\"privateKeyBytes does not contain a valid private key: \" + Arrays.toString(privateKeyBytes))` when BoringSSL rejects the key.\n\nBecause Java logging frameworks commonly call `toString()` for structured objects and commonly persist exception messages, these paths can place complete HPKE private key material in logs or telemetry.\n\n## Proof of concept\n\nSafe local verification was performed without native BoringSSL by compiling the relevant Java classes and a no-op native stub for the unused finalizer reference. The observed output includes the full private key byte array:\n\n```text\nBoringSSLAsymmetricCipherKeyPair{privateKey=BoringSSLAsymmetricKeyParameter{bytes=[1, 2, 3, 4], isPrivate=true}, publicKey=BoringSSLAsymmetricKeyParameter{bytes=[5, 6, 7, 8], isPrivate=false}}\n```\n\nMinimal reproducer concept in the same package:\n\n```java\npackage io.netty.incubator.codec.hpke.boringssl;\n\npublic final class VerifyPrivateKeyToString {\n  public static void main(String[] args) {\n    byte[] privateKey = new byte[] {1, 2, 3, 4};\n    byte[] publicKey = new byte[] {5, 6, 7, 8};\n    BoringSSLAsymmetricCipherKeyPair pair = new BoringSSLAsymmetricCipherKeyPair(privateKey, publicKey);\n    System.out.println(pair.toString());\n  }\n}\n```\n\nThe code path is deterministic: the production `toString()` methods concatenate the raw private-key byte array.\n\n## Impact\n\nIf an affected key pair or initialization exception is logged, application logs contain complete HPKE private key material. Anyone with access to those logs can recover the key. Depending on key reuse and log retention, this can compromise:\n\n- confidentiality of OHTTP messages encrypted to the exposed key;\n- integrity/authenticity expectations for future messages if the key remains active;\n- incident response and key rotation assumptions, because logs may retain key material long after the in-memory key is rotated.\n\n## Suggested remediation\n\n- Redact private key material in `BoringSSLAsymmetricKeyParameter.toString()` when `isPrivate` is true, for example `bytes=<redacted>` or only key type/length.\n- Redact `privateKey` in `BoringSSLAsymmetricCipherKeyPair.toString()`.\n- Remove `Arrays.toString(privateKeyBytes)` from `BoringSSL.EVP_HPKE_KEY_init_or_throw(...)`; report only length and KEM metadata.\n- Add regression tests asserting that `toString()` and exception messages do not contain private key byte values.\n- Consider making key pair classes avoid implementing detailed `toString()` for sensitive material entirely.\n\n## References\n\n- `codec-ohttp-hpke-classes-boringssl/src/main/java/io/netty/incubator/codec/hpke/boringssl/BoringSSLAsymmetricCipherKeyPair.java:72-78`\n- `codec-ohttp-hpke-classes-boringssl/src/main/java/io/netty/incubator/codec/hpke/boringssl/BoringSSLAsymmetricKeyParameter.java:70-76`\n- `codec-ohttp-hpke-classes-boringssl/src/main/java/io/netty/incubator/codec/hpke/boringssl/BoringSSL.java:228-232`",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.netty.incubator:netty-incubator-codec-ohttp-hpke-classes-boringssl"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.23.Final"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.0.22.Final"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/netty/netty-incubator-codec-ohttp/security/advisories/GHSA-2mc4-j865-9q4r"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/netty/netty-incubator-codec-ohttp"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/netty/netty-incubator-codec-ohttp/releases/tag/netty-incubator-codec-parent-ohttp-0.0.23.Final"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-312", "CWE-532" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-20T18:43:17Z",
    "nvd_published_at" : null
  }
}