CVEfocus › CVE database › CVE-2021-4456

CVE-2021-4456Net::CIDR versions before 0.24 for Perl mishandle leading zeros in IP CIDR addresses,…

CVSS 6.5 MediumEPSS 0.4% (higher than 23% of CVEs)Published 2026-02-27Updated 2026-02-27Assigner: CPANSec

Net::CIDR versions before 0.24 for Perl mishandle leading zeros in IP CIDR addresses, which may have unspecified impact. The functions `addr2cidr` and `cidrlookup` may return leading zeros in a CIDR string, which may in turn be parsed as octal numbers by subsequent users. In some cases an attacker may be able to leverage this to bypass access controls based on IP addresses. The documentation advises validating untrusted CIDR strings with the `cidrvalidate` function. However, this mitigation is optional and not enforced by default. In practice, users may call `addr2cidr` or `cidrlookup` with untrusted input and without validation, incorrectly assuming that this is safe.

CWE-704

What to do

Fixed builds are available from Debian, Ubuntu: see the table below for the fixed version per release.

Debian, Ubuntu have not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

4Fixed
5Fix pending
1Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 25.10libnet-cidr-perlNot affected
vulnerable_code_not_present
Ubuntu 24.04libnet-cidr-perlFixed0.21-2ubuntu0.2UBUNTU-CVE-2021-4456
Ubuntu 22.04libnet-cidr-perlFixed0.21-1ubuntu0.2UBUNTU-CVE-2021-4456
Ubuntu 20.04libnet-cidr-perlFix pending0.20-1ubuntu0.1~esm2 (Ubuntu Pro)UBUNTU-CVE-2021-4456
Ubuntu 18.04libnet-cidr-perlFix pending0.18-1ubuntu0.1~esm2 (Ubuntu Pro)UBUNTU-CVE-2021-4456
Ubuntu 16.04libnet-cidr-perlFix pending0.17-1ubuntu0.16.04.1~esm2 (Ubuntu Pro)UBUNTU-CVE-2021-4456
Ubuntu 14.04libnet-cidr-perlFix pending0.17-1ubuntu0.14.04.1~esm2 (Ubuntu Pro)UBUNTU-CVE-2021-4456
Debian 14libnet-cidr-perlFixed0.25-1DEBIAN-CVE-2021-4456
Debian 13libnet-cidr-perlFixed0.25-1DEBIAN-CVE-2021-4456
Debian 12libnet-cidr-perlFix pendingDEBIAN-CVE-2021-4456

What the vendor says

As published in the CVE record by CPANSec, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Solution: Use the `cidrvalidate` function on untrusted input before passing to the affected functions or upgrade to version 0.24 or later

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.