Skip to content
OpenAdvisories
Medium · 6.5 CVE-2021-4456 EUVD-2021-34770GHSA-6xjh-63ff-92mc

Net::CIDR versions before 0.24 for Perl mishandle leading zeros in IP CIDR addresses, which may have unspecified impact

Published Feb 27, 2026 · Updated Feb 27, 2026 · Assigned by CPANSec

Description

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.

Affected products

VendorProductAffectedFixed
MRSAM Net::CIDR < 0.24 0.24

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 libnet-cidr-perl 0.25-1 —
Debian 13 libnet-cidr-perl 0.25-1 —
Debian 12 libnet-cidr-perl No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu 24.04 LTS libnet-cidr-perl 0.21-2ubuntu0.2 —
Ubuntu 22.04 LTS libnet-cidr-perl 0.21-1ubuntu0.2 —
Show 4 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 20.04 LTS libnet-cidr-perl 0.20-1ubuntu0.1~esm2 —
Ubuntu Pro 18.04 LTS libnet-cidr-perl 0.18-1ubuntu0.1~esm2 —
Ubuntu Pro 16.04 LTS libnet-cidr-perl 0.17-1ubuntu0.16.04.1~esm2 —
Ubuntu Pro 14.04 LTS libnet-cidr-perl 0.17-1ubuntu0.14.04.1~esm2 —
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed perl-Net-CIDR 0.270.0-2.1 openSUSE-SU-2026:10756-1

Advisories 2

References