GHSA-MFG7-5GFP-C4W3
Netty: Memory Leak in DNS Record Decoder via Malformed Domain Names
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 4.2.16.Final | io.netty:netty-codec-dns · -17 d desde divulgación | |
| Remediación | Parche 4.1.136.Final | io.netty:netty-codec-dns · -16 d desde divulgación | |
| Divulgación | Publicada | GHSA-MFG7-5GFP-C4W3 divulgada | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice |
### Summary
A memory leak can be caused in Netty's DNS codec by sending malicious DNS packets containing invalid domain names. Because the leak occurs incrementally per packet, sustained malicious requests will cause a gradual Denial of Service.
### Details
Inside `io.netty.handler.codec.dns.AbstractDnsRecord`, the parsed domain name string is passed to `IDN.toASCII(name)`. If the domain name contains characters that violate IDNA rules, `IDN.toASCII` throws an `IllegalArgumentException`.
Because this exception occurs inside the constructor before the `DnsRecord` instance can assign the buffer to its content field for later release, the ByteBuf whose reference count was incremented (or newly allocated) is never released, resulting in a direct memory leak.
There are several places where variants of this leak happen:
- `io.netty.handler.codec.dns.DefaultDnsRecordDecoder#decodeRecord(java.lang.String, io.netty.handler.codec.dns.DnsRecordType, int, long, io.netty.buffer.ByteBuf, int, int)` invokes `in.retainedDuplicate()` or creates a new buffer `out` when constructing `DefaultDnsRawRecord`
- `io.netty.handler.codec.dns.DnsCodecUtil#decompressDomainName` allocates a new `ByteBuf` and passes it to `encodeDomainName()`. If the decompressed domain name contains a null byte (`\0`), `encodeDomainName()` throws an `IllegalArgumentException`, leaking the newly allocated buffer.
### Impact
Resource Exhaustion. Any application utilizing Netty's DnsRecordDecoder (such as DnsNameResolver or custom DNS servers) is vulnerable.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
mavenio.netty:netty-codec-dns |
Corregida | 4.1.136.Final, 4.2.16.Final | -16 d · -17 d | 4.2.20.Final no afectada |
4.1.136.Final4.2.16.FinalArsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/netty/netty/security/advisories/GHSA-mfg7-5gfp-c4w3https://github.com/netty/netty/pull/17063https://github.com/netty/netty/pull/17065https://github.com/netty/netty/commit/5b68c61f37aa4a3045cba624cbea239655c9003bhttps://github.com/netty/netty/commit/bb2ff68a1fb71cb4b0eb9a9e17b66c52aff680c6https://github.com/netty/nettyhttps://github.com/netty/netty/releases/tag/netty-4.1.136.Finalhttps://github.com/netty/netty/releases/tag/netty-4.2.16.FinalLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
