CVE-2021-4456 Details
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.
A vulnerability exists in Net::CIDR versions prior to 0.24 for Perl, where leading zeros in IP CIDR addresses are mishandled. This issue can lead to unintended consequences, such as bypassing access controls based on IP addresses. The functions 'addr2cidr' and 'cidrlookup' are affected, as they may introduce leading zeros that subsequent users could misinterpret as octal numbers. Although the documentation recommends validating untrusted CIDR strings with the 'cidrvalidate' function, this guidance is optional and not enforced by default. As a result, users may inadvertently use 'addr2cidr' or 'cidrlookup' with untrusted input without proper validation, assuming it is safe.
Users can upgrade to Net::CIDR version 0.25 or later, which addresses the vulnerability by removing extra leading zeros from octets. After updating, it's important to review the use of the 'cidrvalidate' function to ensure proper validation of CIDR strings.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Feb 27, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://blog.urth.org/2021/03/29/security-issues-in-perl-ip-address-distros/ | CPANSec | Third Party Advisory |
| https://github.com/svarshavchik/Net-CIDR/commit/e3648c6bc6bdd018f90cca4149c467017d42bd10 | CPANSec | Patch |
| https://metacpan.org/dist/Net-CIDR/changes | CPANSec | Release Notes |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-704 | Incorrect Type Conversion or Cast | CPANSec |
Affected Products
| Product | Versions |
|---|---|
| mrsam net::cidr | < 0.24 |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | CPANSec |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Mar 3, 2026 | Initial Analysis | [email protected] |
| Feb 27, 2026 | CVE Modified | CISA-ADP |
| Feb 27, 2026 | New CVE Received | CPANSec |