製品・ソフトウェアに関する情報
Stig (stigtsp)のNet::CIDR::Liteにおける入力の構文的正当性の検証に関する脆弱性
Title Stig (stigtsp)のNet::CIDR::Liteにおける入力の構文的正当性の検証に関する脆弱性
Summary

Perl用Net::CIDR::Liteのバージョン0.23未満には、IPv6のグループ数を検証しないため、IP ACLのバイパスを許す可能性がある脆弱性があります。_pack_ipv6()関数は、圧縮されていないIPv6アドレス(::なし)が正確に8つの16進数グループを持つかどうかをチェックしません。例えば、"abcd"、"1:2:3"、"1:2:3:4:5:6:7"のような入力が受け入れられ、誤った長さ(3、7、または15バイトで、正しいのは17バイト)のパック値が生成されます。これらのパック値は内部でマスクや比較操作に使用され、find()およびbin_find()関数はそれらの値に対してPerlの文字列比較(lt/gt)を行うため、異なる長さの文字列を比較すると誤った結果が生じます。これにより、find()関数はアドレスが範囲内または範囲外であると誤って報告する可能性があります。例えば、my $cidr = Net::CIDR::Lite-new("::/8"); $cidr-find("1:2:3");は無効な入力ですが誤ってtrueを返します。この問題は、以前にこのモジュールで修正されたIPv4の先頭ゼロに関する入力検証問題と同様の入力検証問題です。同じ関数でIPv4マップドIPv6アドレスに影響する関連問題も存在します。

Possible impacts 当該ソフトウェアが扱う情報について、外部への漏えいは発生しません。 また、当該ソフトウェアが扱う全ての情報が書き換えられる可能性があります。 さらに、当該ソフトウェアは停止しません。 そして、この脆弱性を悪用した攻撃の影響は、他のソフトウェアには及びません。 
Solution

正式な対策が公開されています。ベンダ情報を参照して適切な対策を実施してください。

Publication Date April 10, 2026, midnight
Registration Date April 23, 2026, 10:16 a.m.
Last Update April 23, 2026, 5:52 p.m.
CVSS3.0 : 重要
Score 7.5
Vector CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Affected System
Stig (stigtsp)
Net::CIDR::Lite 0.23 未満
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
その他
Change Log
No Changed Details Date of change
1 [2026年04月23日]
  掲載
April 23, 2026, 10:16 a.m.

NVD Vulnerability Information
CVE-2026-40198
Summary

Net::CIDR::Lite versions before 0.23 for Perl does not validate IPv6 group count, which may allow IP ACL bypass.

_pack_ipv6() does not check that uncompressed IPv6 addresses (without ::) have exactly 8 hex groups. Inputs like "abcd", "1:2:3", or "1:2:3:4:5:6:7" are accepted and produce packed values of wrong length (3, 7, or 15 bytes instead of 17).

The packed values are used internally for mask and comparison operations. find() and bin_find() use Perl string comparison (lt/gt) on these values, and comparing strings of different lengths gives wrong results. This can cause find() to incorrectly report an address as inside or outside a range.

Example:

my $cidr = Net::CIDR::Lite->new("::/8");
$cidr->find("1:2:3"); # invalid input, incorrectly returns true

This is the same class of input validation issue as CVE-2021-47154 (IPv4 leading zeros) previously fixed in this module.

See also CVE-2026-40199, a related issue in the same function affecting IPv4 mapped IPv6 addresses.

Publication Date April 11, 2026, 7:16 a.m.
Registration Date April 15, 2026, 11:37 a.m.
Last Update April 22, 2026, 3:49 a.m.
Affected software configurations
Configuration1 or higher or less more than less than
cpe:2.3:a:stigtsp:net\:\:cidr\:\:lite:*:*:*:*:*:perl:*:* 0.23
Related information, measures and tools
Common Vulnerabilities List
CVE-2026-40199
Summary

Net::CIDR::Lite versions before 0.23 for Perl mishandles IPv4 mapped IPv6 addresses, which may allow IP ACL bypass.

_pack_ipv6() includes the sentinel byte from _pack_ipv4() when building the packed representation of IPv4 mapped addresses like ::ffff:192.168.1.1. This produces an 18 byte value instead of 17 bytes, misaligning the IPv4 part of the address.

The wrong length causes incorrect results in mask operations (bitwise AND truncates to the shorter operand) and in find() / bin_find() which use Perl string comparison (lt/gt). This can cause find() to incorrectly match or miss addresses.

Example:

my $cidr = Net::CIDR::Lite->new("::ffff:192.168.1.0/120");
$cidr->find("::ffff:192.168.2.0"); # incorrectly returns true

This is triggered by valid RFC 4291 IPv4 mapped addresses (::ffff:x.x.x.x).

See also CVE-2026-40198, a related issue in the same function affecting malformed IPv6 addresses.

Publication Date April 11, 2026, 7:16 a.m.
Registration Date April 15, 2026, 11:37 a.m.
Last Update April 22, 2026, 3:41 a.m.
Affected software configurations
Configuration1 or higher or less more than less than
cpe:2.3:a:stigtsp:net\:\:cidr\:\:lite:*:*:*:*:*:perl:*:* 0.23
Related information, measures and tools
Common Vulnerabilities List