← Vulnerability Intelligence

CVE-2026-61798

netty-incubator-codec-ohttp: BoringSSL HPKE private key bytes exposed through toString() and exception messages

high broaderGHSA-2mc4-j865-9q4rCVE-2026-61798

Entropy / wallet impact

io.netty.incubator:netty-incubator-codec-ohttp-hpke-classes-boringssl: ## Summary `io.netty.incubator:netty-incubator-codec-ohttp-hpke-classes-boringssl` exposes raw HPKE private key bytes in string representations and error messages.

Description

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():

codec-ohttp-hpke-classes-boringssl/src/main/java/io/netty/incubator/codec/hpke/boringssl/BoringSSLAsymmetricKeyParameter.java then renders all bytes:

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:

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:

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:

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:

Suggested remediation

References

Affected

KindNameEcosystemVersions
packageio.netty.incubator:netty-incubator-codec-ohttp-hpke-classes-boringsslmaven<= 0.0.22.Final

CWE

CWE-312CWE-532CWE-200

Primary sources

Published
2026-08-20T18:43:17Z
Last modified
2026-08-20T18:43:19Z
First seen here
2026-08-21T05:18:55Z
CVSS
8.1 · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N (ghsa)
Credibility
official_cve