CVE-2026-19566: CWE-1284 Improper Validation of Specified Quantity in Input in RRWO Net::CIDR::Set
Net::CIDR::Set versions before 0.23 for Perl allow memory exhaustion and malformed set ranges via unbounded IPv6 prefix lengths. The _encode method accepts any prefix length matching `(0|[1-9][0-9]*)` and passes it to _width2bits(), which builds the mask as `'1' x ($width + 8)`, one character per bit. The _inc() method then unpacks the packed mask into a Perl array of one scalar per byte, so the prefix length alone sets the allocation size: `::/100000000` builds a 100 MB string and a 12.5 million element array. The value being tested is parsed, not just the configured ranges: contains() builds a set from its argument, and _guess_coder() tries the IPv4 coder and then the IPv6 coder, so an IPv4-only set expands an oversized IPv6 prefix length before the mixed address width check rejects it. Any caller that passes untrusted input to contains() or add() can exhaust process memory. A prefix length above 128 is also stored as a range that does not match the requested block: 2001:db8::/129 stringifies back unchanged, contains() of its own base address returns false, and removing it from a set drops the base address while the set still prints as covering it.
AI Analysis
Technical Summary
Net::CIDR::Set versions prior to 0.23 improperly validate IPv6 prefix lengths in the _encode method, accepting any numeric prefix length without upper bounds. This leads to excessive memory allocation when large prefix lengths are processed, as the mask string and unpacked array sizes scale with the prefix length. The contains() and add() methods can be exploited by passing untrusted input with oversized prefix lengths, causing memory exhaustion and malformed set ranges. Additionally, prefix lengths above 128 result in ranges that do not match the requested block, causing logical inconsistencies in set operations.
Potential Impact
An attacker who can supply untrusted input to the contains() or add() methods can cause the process to exhaust available memory, potentially leading to denial of service. Furthermore, malformed set ranges with prefix lengths above 128 can cause incorrect behavior in set membership checks and removals, potentially affecting application logic relying on accurate CIDR set operations.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid passing untrusted or unchecked IPv6 prefix lengths to the contains() or add() methods in Net::CIDR::Set. Implement input validation to restrict prefix lengths to valid ranges (0 to 128) before processing.
CVE-2026-19566: CWE-1284 Improper Validation of Specified Quantity in Input in RRWO Net::CIDR::Set
Description
Net::CIDR::Set versions before 0.23 for Perl allow memory exhaustion and malformed set ranges via unbounded IPv6 prefix lengths. The _encode method accepts any prefix length matching `(0|[1-9][0-9]*)` and passes it to _width2bits(), which builds the mask as `'1' x ($width + 8)`, one character per bit. The _inc() method then unpacks the packed mask into a Perl array of one scalar per byte, so the prefix length alone sets the allocation size: `::/100000000` builds a 100 MB string and a 12.5 million element array. The value being tested is parsed, not just the configured ranges: contains() builds a set from its argument, and _guess_coder() tries the IPv4 coder and then the IPv6 coder, so an IPv4-only set expands an oversized IPv6 prefix length before the mixed address width check rejects it. Any caller that passes untrusted input to contains() or add() can exhaust process memory. A prefix length above 128 is also stored as a range that does not match the requested block: 2001:db8::/129 stringifies back unchanged, contains() of its own base address returns false, and removing it from a set drops the base address while the set still prints as covering it.
CVSS v3.1
Score 7.5high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Net::CIDR::Set versions prior to 0.23 improperly validate IPv6 prefix lengths in the _encode method, accepting any numeric prefix length without upper bounds. This leads to excessive memory allocation when large prefix lengths are processed, as the mask string and unpacked array sizes scale with the prefix length. The contains() and add() methods can be exploited by passing untrusted input with oversized prefix lengths, causing memory exhaustion and malformed set ranges. Additionally, prefix lengths above 128 result in ranges that do not match the requested block, causing logical inconsistencies in set operations.
Potential Impact
An attacker who can supply untrusted input to the contains() or add() methods can cause the process to exhaust available memory, potentially leading to denial of service. Furthermore, malformed set ranges with prefix lengths above 128 can cause incorrect behavior in set membership checks and removals, potentially affecting application logic relying on accurate CIDR set operations.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid passing untrusted or unchecked IPv6 prefix lengths to the contains() or add() methods in Net::CIDR::Set. Implement input validation to restrict prefix lengths to valid ranges (0 to 128) before processing.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- CPANSec
- Date Reserved
- 2026-08-11T18:53:07.963Z
- Cvss Version
- null
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a7c3561bf8831d539492c1d
Added to database: 08/12/2026, 08:57:05 UTC
Last enriched: 08/12/2026, 09:15:32 UTC
Last updated: 09/07/2026, 20:07:40 UTC
Views: 64
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.