Security Advisories (2)
CVE-2026-129891 (2026-11-17)

IO::Socket::SSL::PublicSuffix versions through 2.099 for Perl let an on-path attacker choose the installed public suffix list because update_self_from_url fetches it over cleartext HTTP with no integrity check. Called with no argument, as the module's documentation shows, the updater fetches the list from the `http://` address in the URL constant and checks only that the request succeeded, with no signature or digest over the response. The lines that come back are written into the module's own source file as the built-in list. An attacker on the network path when the updater runs chooses the suffix boundary the module reports to every caller on the host, and that answer persists in the installed module until it is reinstalled. Dropping one rule makes the hostname check in IO::Socket::SSL accept a wildcard certificate that spans the whole public suffix that rule named.

CVE-2026-129892 (2026-11-17)

IO::Socket::SSL::PublicSuffix versions through 2.099 for Perl allow code injection via a fetched list line that closes the built-in data heredoc when update_self_from_url rewrites the module's source. The rewrite copies the module's source down to the built-in list's heredoc and appends each fetched line below it. Nothing checks that a line looks like a domain. A line that is not a comment loses only what follows a `//` and its trailing whitespace, so a line reading END_BUILTIN_DATA is appended as it stands and ends the data block in the rewritten file. Every fetched line after it is Perl. Arbitrary Perl runs in every process that loads IO::Socket::SSL, which loads this module unconditionally, until the file is reinstalled. The attacker must control the fetched list, through the cleartext default URL or a caller-supplied one, and the updater must run with write access to the installed module.

NAME

IO::Socket::SSL::PublicSuffix - provide access to Mozilla's list of effective TLD names

SYNOPSIS

   # use builtin default
   use IO::Socket::SSL::PublicSuffix;
   $ps = IO::Socket::SSL::PublicSuffix->default;

   # load from string
   $ps = IO::Socket::SSL::PublicSuffix->from_string("*.uk\n*");

   # load from file or file handle
   $ps = IO::Socket::SSL::PublicSuffix->from_file($filename);
   $ps = IO::Socket::SSL::PublicSuffix->from_file(\*STDIN);


   # --- string in -> string out
   # $rest -> whatever.host
   # $tld  -> co.uk
   my ($rest,$tld) = $ps->public_suffix('whatever.host.co.uk');
   my $tld = $ps->public_suffix('whatever.host.co.uk');

   # $root_domain -> host.co.uk
   my $root_domain = $ps->public_suffix('whatever.host.co.uk', 1);

   # --- array in -> array out
   # $rest -> [qw(whatever host)]
   # $tld  -> [qw(co uk)]
   my ($rest,$tld) = $ps->public_suffix([qw(whatever host co uk)]);

----

   # To update this file with the current list:
   perl -MIO::Socket::SSL::PublicSuffix -e 'IO::Socket::SSL::PublicSuffix::update_self_from_url()'

DESCRIPTION

This module uses the list of effective top level domain names from the mozilla project to determine the public top level domain for a given hostname.

Method

class->default(%args)

Returns object with builtin default. min_suffix can be given in %args to specify the minimal suffix, default is 1.

class->from_string(string,%args)

Returns object with configuration from string. See method default for %args.

class->from_file( file name| file handle, %args )

Returns object with configuration from file or file handle. See method default for %args.

$self->public_suffix( $host|\@host, [ $add ] )

In array context the function returns the non-tld part and the tld part of the given hostname, in scalar context only the tld part. It adds $add parts of the non-tld part to the tld, e.g. with $add=1 it will return the root domain.

If there were no explicit matches against the public suffix configuration it will fall back to a suffix of length 1.

The function accepts a string or an array-ref (e.g. host split by .). In the first case it will return string(s), in the latter case array-ref(s).

International hostnames or labels can be in ASCII (IDNA form starting with xn--) or unicode. In the latter case an IDNA handling library needs to be available. URI is preferred, but Net::IDN:::Encode, Net::LibIDN are still supported.

($self|class)->can_idn

Returns true if IDN support is available.

FILES

http://publicsuffix.org/list/effective_tld_names.dat

SEE ALSO

Domain::PublicSuffix, Mozilla::PublicSuffix

BUGS

Q: Why yet another module, we already have L<Domain::PublicSuffix> and
   L<Mozilla::PublicSuffix>.
A: Because the public suffix data change more often than these modules do,
   IO::Socket::SSL needs this list and it is more easy this way to keep it
   up-to-date.

AUTHOR

Steffen Ullrich