The analysis was performed by first identifying the patched versions from the vulnerability description (4.2.13.Final and 4.1.133.Final) and their corresponding vulnerable predecessors (4.2.12.Final and 4.1.132.Final). By comparing the git tags for these versions, the specific commits that contain the security fix were located. The primary fixing commit is 6459a284e6653c90fe4b15c0e8516d8302b1cd0e.
An examination of this commit's patch file reveals changes exclusively in io.netty.handler.codec.dns.DnsCodecUtil.java. The changes directly address the described vulnerabilities by adding strict input validation checks to two static methods: encodeDomainName and decodeDomainName.
-
encodeDomainName: The patch adds checks to throw exceptions if a domain name contains empty labels, labels longer than 63 bytes, null characters, or if the total length exceeds 255 bytes. The vulnerable version lacked these checks, making it susceptible to creating malformed DNS queries.
-
decodeDomainName: The patch adds checks to throw an exception if a decoded label exceeds 63 bytes or if the total decoded domain name exceeds 255 bytes. The vulnerable version lacked these checks, leading to an uncontrolled resource consumption vulnerability.
These two functions are the root cause of the vulnerability. Any exploitation attempt would necessarily involve one or both of these functions processing malicious data, making them the key indicators in a runtime profile.