CVE-2025-40910

6.5 MEDIUM

📋 TL;DR

This vulnerability in Net::IP::LPM Perl module allows attackers to bypass IP-based access controls by using IP addresses with leading zeros, which are interpreted as octal numbers. Systems using this module for IP address validation or access control lists are affected. The issue stems from improper parsing of CIDR address strings.

💻 Affected Systems

Products:
  • Net::IP::LPM Perl module
Versions: Version 1.10 specifically
Operating Systems: Any OS running Perl with Net::IP::LPM
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems using Net::IP::LPM for IP address validation or access control. The vulnerability is in the parsing logic itself.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete bypass of network security controls, allowing unauthorized access to protected systems or data.

🟠

Likely Case

Partial access control bypass for specific IP ranges, potentially exposing sensitive interfaces or data.

🟢

If Mitigated

Limited impact if additional authentication layers or network segmentation exist beyond IP-based controls.

🌐 Internet-Facing: HIGH - Internet-facing systems using this module for IP filtering are directly vulnerable to bypass attempts.
🏢 Internal Only: MEDIUM - Internal systems using IP-based controls could be bypassed by internal attackers or compromised hosts.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW - Attackers only need to craft IP addresses with leading zeros.

Exploitation requires knowledge of IP ranges being filtered and ability to send requests from crafted IP addresses.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Apply patch from security advisory

Vendor Advisory: https://security.metacpan.org/patches/N/Net-IP-LPM/1.10/CVE-2025-40910-r1.patch

Restart Required: No

Instructions:

1. Download the patch from the vendor advisory URL
2. Apply patch to Net::IP::LPM installation: patch -p1 < CVE-2025-40910-r1.patch
3. Reinstall or update the Perl module: cpanm --reinstall Net::IP::LPM

🔧 Temporary Workarounds

Input validation wrapper

all

Add custom validation to strip leading zeros from IP addresses before passing to Net::IP::LPM

# Perl example: $ip =~ s/^0+//g; before calling Net::IP::LPM functions

Use alternative IP validation

all

Temporarily replace Net::IP::LPM with another IP validation library

# Consider using Net::CIDR::Lite or Net::Netmask as alternatives

🧯 If You Can't Patch

  • Implement network-level controls (firewall rules) as additional protection layer
  • Add application-level authentication beyond IP-based controls

🔍 How to Verify

Check if Vulnerable:

Check if Net::IP::LPM version 1.10 is installed: perl -MNet::IP::LPM -e 'print $Net::IP::LPM::VERSION'

Check Version:

perl -MNet::IP::LPM -e 'print "Net::IP::LPM version: $Net::IP::LPM::VERSION\n"'

Verify Fix Applied:

Test IP validation with leading zeros (e.g., 010.0.0.1) - should be rejected or normalized

📡 Detection & Monitoring

Log Indicators:

  • Unusual IP addresses with leading zeros in access logs
  • Failed access attempts from unexpected IP ranges

Network Indicators:

  • Traffic from IP addresses with leading zeros in octets
  • Bypass of expected IP filtering rules

SIEM Query:

source="access.log" AND (ip="0[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+" OR ip="[0-9]+\.0[0-9]+\.[0-9]+\.[0-9]+" OR ip="[0-9]+\.[0-9]+\.0[0-9]+\.[0-9]+" OR ip="[0-9]+\.[0-9]+\.[0-9]+\.0[0-9]+")

🔗 References

📤 Share & Export