CVE-2021-4456
Net::CIDR versions before 0.24 for Perl mishandle leading zeros in IP CIDR addresses, which may have unspecified impact
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.
INFO
Published Date :
Feb. 27, 2026, 1:16 a.m.
Last Modified :
March 3, 2026, 8:25 p.m.
Remotely Exploit :
Yes !
Source :
9b29abf9-4ab0-4765-b253-1875cd9b441e
CVSS Scores
| Score | Version | Severity | Vector | Exploitability Score | Impact Score | Source |
|---|---|---|---|---|---|---|
| CVSS 3.1 | MEDIUM | 134c704f-9b21-4f2e-91b3-4a467353bcc0 |
Solution
- Update Net::CIDR to version 0.24 or later.
- Validate all untrusted CIDR strings.
- Ensure validation uses the `cidrvalidate` function.
- Configure validation to be enforced by default.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2021-4456.
| URL | Resource |
|---|---|
| https://blog.urth.org/2021/03/29/security-issues-in-perl-ip-address-distros/ | Third Party Advisory |
| https://github.com/svarshavchik/Net-CIDR/commit/e3648c6bc6bdd018f90cca4149c467017d42bd10 | Patch |
| https://metacpan.org/dist/Net-CIDR/changes | Release Notes |
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2021-4456 is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2021-4456
weaknesses.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2021-4456 vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2021-4456 vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
Initial Analysis by [email protected]
Mar. 03, 2026
Action Type Old Value New Value Added CPE Configuration OR *cpe:2.3:a:mrsam:net::cidr:*:*:*:*:*:perl:*:* versions up to (excluding) 0.24 Added Reference Type CPANSec: https://blog.urth.org/2021/03/29/security-issues-in-perl-ip-address-distros/ Types: Third Party Advisory Added Reference Type CPANSec: https://github.com/svarshavchik/Net-CIDR/commit/e3648c6bc6bdd018f90cca4149c467017d42bd10 Types: Patch Added Reference Type CPANSec: https://metacpan.org/dist/Net-CIDR/changes Types: Release Notes -
CVE Modified by 134c704f-9b21-4f2e-91b3-4a467353bcc0
Feb. 27, 2026
Action Type Old Value New Value Added CVSS V3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N -
New CVE Received by 9b29abf9-4ab0-4765-b253-1875cd9b441e
Feb. 27, 2026
Action Type Old Value New Value Added 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. Added CWE CWE-704 Added Reference https://blog.urth.org/2021/03/29/security-issues-in-perl-ip-address-distros/ Added Reference https://github.com/svarshavchik/Net-CIDR/commit/e3648c6bc6bdd018f90cca4149c467017d42bd10 Added Reference https://metacpan.org/dist/Net-CIDR/changes