Security Advisories (2)
CVE-2026-64193 (2026-07-20)

Net::DNS versions through 1.55 for Perl allow remote execution injection via EDNS EXTENDED ERROR. Net::DNS::RR::OPT::EXTENDED_ERROR::_decompose parses the EXTRA-TEXT field of an EDNS EXTENDED-ERROR option (RFC 8914) by tokenising the raw bytes and passing the result to Perl's eval. There is some escaping done for $ and @, but not for backticks. This can be exploited for command execution if $pkt->edns->option('EXTENDED-ERROR') is called in array context, for example with a payload of {0:`"<command>"`} in EXTRA-TEXT.

CVE-2026-64194 (2026-07-20)

Net::DNS versions through 1.55 for Perl allow Denial of Service via deep DNS compression pointer chains. Net::DNS::DomainName::decode follows RFC 1035 compression pointers by recursing into itself with no depth limit. It is possible to construct a name which saturates the call stack (at least with larger TCP responses), leading to a potential Denial of Service. The guard `$link < $offset` prevents forward and circular chains, but still allows arbitrarily long backward chains. The per-offset cache (`$cache`) is populated at the start of each call and short-circuits only re-traverses of the same offset - the initial descent through a fresh chain still recurses at full depth. A crafted packet can chain two-byte compression pointers so that each one points two bytes earlier than the previous, producing a chain length of `offset / 2`. For the 14-bit pointer field (max offset 16383) this gives up to ~8191 recursive frames. For a TCP DNS message the limit is the 16-bit length field (~32767 frames). Perl's default C stack handles only a few thousand frames; beyond that the process receives SIGSEGV or similar, which is a denial-of-service for any application parsing untrusted DNS data. The vulnerability is triggered by `Net::DNS::Packet->new(\$wire)` i.e. any point where the library decodes a DNS message from the network.

NAME

Net::DNS::DomainName - DNS domain name wire representation

SYNOPSIS

use Net::DNS::DomainName;

$object = new Net::DNS::DomainName('example.com');
$name = $object->name;
$data = $object->encode;

( $object, $next ) = decode Net::DNS::DomainName( \$data, $offset );

DESCRIPTION

The Net::DNS::DomainName module implements the concrete representation of DNS domain names used within DNS packets.

Net::DNS::DomainName defines methods for encoding and decoding wire format octet strings as defined in RFC1035. All other behaviour, including the new() constructor, is inherited from Net::DNS::Domain.

The Net::DNS::DomainName1035 and Net::DNS::DomainName2535 packages implement disjoint domain name subtypes which provide the name compression and canonicalisation specified by RFC1035 and RFC2535. These are necessary to meet the backward compatibility requirements introduced by RFC3597.

METHODS

new

$object = new Net::DNS::DomainName('example.com');

Creates a domain name object which identifies the domain specified by the character string argument.

decode

$object = decode Net::DNS::DomainName( \$buffer, $offset, $hash );

( $object, $next ) = decode Net::DNS::DomainName( \$buffer, $offset, $hash );

Creates a domain name object which represents the DNS domain name identified by the wire-format data at the indicated offset within the data buffer.

The argument list consists of a reference to a scalar containing the wire-format data and specified offset. The optional reference to a hash table provides improved efficiency of decoding compressed names by exploiting already cached compression pointers.

The returned offset value indicates the start of the next item in the data buffer.

encode

$data = $object->encode;

Returns the wire-format representation of the domain name suitable for inclusion in a DNS packet buffer.

Net::DNS::DomainName1035

Net::DNS::DomainName1035 implements a subclass of domain name objects which are to be encoded using the compressed wire format defined in RFC1035.

use Net::DNS::DomainName;

$object = new Net::DNS::DomainName1035('compressible.example.com');
$data   = $object->encode( $offset, $hash );

( $object, $next ) = decode Net::DNS::DomainName1035( \$data, $offset );

Note that RFC3597 implies that the RR types defined in RFC1035 section 3.3 are the only types eligible for compression.

encode

$data = $object->encode( $offset, $hash );

Returns the wire-format representation of the domain name suitable for inclusion in a DNS packet buffer.

The optional arguments are the offset within the packet data where the domain name is to be stored and a reference to a hash table used to index compressed names within the packet.

If the hash reference is undefined, encode() returns the lowercase uncompressed canonical representation defined in RFC2535(8.1).

Net::DNS::DomainName2535

Net::DNS::DomainName2535 implements a subclass of domain name objects which are to be encoded using uncompressed wire format.

Note that RFC3597, and latterly RFC4034, specifies that the lower case canonical encoding defined in RFC2535 is to be used for RR types defined prior to RFC3597.

use Net::DNS::DomainName;

$object = new Net::DNS::DomainName2535('incompressible.example.com');
$data   = $object->encode( $offset, $hash );

( $object, $next ) = decode Net::DNS::DomainName2535( \$data, $offset );

encode

$data = $object->encode( $offset, $hash );

Returns the uncompressed wire-format representation of the domain name suitable for inclusion in a DNS packet buffer.

If the hash reference is undefined, encode() returns the lowercase canonical form defined in RFC2535(8.1).

COPYRIGHT

Copyright (c)2009-2011 Dick Franks.

All rights reserved.

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

perl, Net::DNS, Net::DNS::Domain, RFC1035, RFC2535, RFC3597, RFC4034