CVE-2021-4456
Net::CIDR versions before 0.24 for Perl mishandle leading zeros in IP CIDR addresses, which may have unspecified impact
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
6.5
Net::CIDR versions before 0.24 for Perl mishandle leading zeros in IP CIDR addresses, which may have unspecified impact
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.
- Record
CVE-2021-4456- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-704
- Updated
- 2026-11-02
EUVDEUVD-2021-34770
6.5
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.
- Record
EUVD-2021-34770- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-6xjh-63ff-92mc
6.5
Net::CIDR versions before 0.24 for Perl mishandle leading zeros in IP CIDR addresses, which may...
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.
- Record
GHSA-6xjh-63ff-92mc- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-704
- Updated
- 2026-11-02
NVD
6.5
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.
- Record
CVE-2021-4456- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Weakness
- CWE-704
- Updated
- 2026-11-02
OSV
6.5
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.
- Record
CVE-2021-4456- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Updated
- 2026-11-02
OSVDEBIAN-CVE-2021-4456
6.5
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.
- Record
DEBIAN-CVE-2021-4456- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Updated
- 2026-11-02
Show 4 moreShow less
OSVUBUNTU-CVE-2021-4456
6.5
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.
- Record
UBUNTU-CVE-2021-4456- CVSS 3.1
- 6.5 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N - Updated
- 2026-11-02
OSVopenSUSE-SU-2026:10756-1 No score
perl-Net-CIDR-0.270.0-2.1 on GA media
These are all security issues fixed in the perl-Net-CIDR-0.270.0-2.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:10756-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:20773-1 No score
Security update for perl-Net-CIDR
This update for perl-Net-CIDR fixes the following issues:
Changes in perl-Net-CIDR:
-
updated to 0.270.0 (0.27) 0.27 Sam Varshavchik cidrvalidate() bug fix.
-
updated to 0.260.0 (0.26) 0.26 Sam Varshavchik cidrvalidate() should accept IPv6 addresses with one uncompressed 0.
-
updated to 0.250.0 (0.25) 0.25 Sam Varshavchik Fix warning with Perl 5.40 0.24.1 No changes, re-pushed due to a release problem. 0.24 2025-03-09 brian d foy
- Strip leading zeros from octets from addr2cidr bsc#1259024 CVE-2021-4456
-
updated to 0.230.0 (0.23) 0.23 2025-03-09 brian d foy
- Allow unabbreviated IPv6 addresses. 0.22 2025-03-09 Sam Varshavchik
- Improve several error messages. 2025-03-09 brian d foy
- Allow unabbreviated IPv6 addresses.
- Record
openSUSE-SU-2026:20773-1- Updated
- 2026-11-02
OSVUSN-8110-1 No score
libnet-cidr-perl vulnerability
Dave Rolsky discovered that Net-CIDR did not properly sanitize IP addresses. An attacker could possibly use this to bypass IP-based restrictions.
- Record
USN-8110-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
libnet-cidr-perlDebian:12 |
All versions, plus listed versions 0.21-20.23-10.25-10.27-1 |
None known |
libnet-cidr-perlDebian:13 |
before 0.25-1 | 0.25-1 |
libnet-cidr-perlDebian:14 |
before 0.25-1 | 0.25-1 |
libnet-cidr-perlUbuntu:Pro:14.04:LTS |
before 0.17-1ubuntu0.14.04.1~esm2, plus listed versions 0.17-1 |
0.17-1ubuntu0.14.04.1~esm2 |
libnet-cidr-perlUbuntu:Pro:16.04:LTS |
before 0.17-1ubuntu0.16.04.1~esm2, plus listed versions 0.17-1 |
0.17-1ubuntu0.16.04.1~esm2 |
libnet-cidr-perlUbuntu:Pro:18.04:LTS |
before 0.18-1ubuntu0.1~esm2, plus listed versions 0.18-1 |
0.18-1ubuntu0.1~esm2 |
libnet-cidr-perlUbuntu:Pro:20.04:LTS |
before 0.20-1ubuntu0.1~esm2, plus listed versions 0.20-1 |
0.20-1ubuntu0.1~esm2 |
libnet-cidr-perlUbuntu:22.04:LTS |
before 0.21-1ubuntu0.2, plus listed versions 0.20-10.21-1 |
0.21-1ubuntu0.2 |
libnet-cidr-perlUbuntu:24.04:LTS |
before 0.21-2ubuntu0.2, plus listed versions 0.21-2 |
0.21-2ubuntu0.2 |
perl-Net-CIDRopenSUSE:Tumbleweed |
before 0.270.0-2.1 | 0.270.0-2.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-4456 is a medium vulnerability (CVSS 6.5) in Mrsam Net::cidr, published February 27, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.37%, the 31st percentile. Fixed in libnet-cidr-perl 0.25-1.
References
blog.urth.org/2021/03/29/security-issues-in-perl-ip-address-distros
github.com/svarshavchik/Net-CIDR/commit/e3648c6bc6bdd018f90cca4149c467017d42bd10
metacpan.org/dist/Net-CIDR/changes
nvd.nist.gov/vuln/detail/CVE-2021-4456
github.com/advisories/GHSA-6xjh-63ff-92mc
security-tracker.debian.org/tracker/CVE-2021-4456