# CVE-2026-40558: Net::FTP versions before 3.17 for Perl connect the passive data channel to the address named in the server's PASV reply

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.31% (percentile 25, 2026-12-01)
- **CWE:** CWE-918
- **Published:** 2026-11-29T22:40:29.485Z
- **Modified:** 2026-11-30T01:17:04.910Z

> **AI summary (AI-generated, claude-haiku-5-5):** A malicious FTP server can make Perl's Net::FTP client open TCP connections to arbitrary internal hosts and ports via the PASV reply address.

## Who should check

- Anyone running libnet \< 3.17
- Anyone running perl \>= 5.7.3, \<= 5.45.5

## Description

Net::FTP versions before 3.17 for Perl connect the passive data channel to the address named in the server's PASV reply.

The pasv method uses the IP address from the server's 227 reply for the data connection and never compares it with the control connection's peer.

A malicious FTP server can make the client open TCP connections to arbitrary hosts and ports, including internal addresses reachable only from the client.

## Affected and fixed versions

- libnet: \< 3.17 (cvelist)
- perl: \>= 5.7.3, \<= 5.45.5 (cvelist)

## Technologies

PHP (AI-matched)

## Mitigation

- Upgrade libnet to 3.17 or later.
- Vendor workaround: Install libnet 3.17 or later into your @INC include path, so it takes precedence over the vulnerable core module shipped with Perl.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-40558. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-40558.md
Affected: libnet < 3.17; perl >= 5.7.3, <= 5.45.5
Fixed in: libnet 3.17

Steps:
1. Search this machine and project for libnet, perl: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-40558 being exploited?

There is no confirmed exploitation: CVE-2026-40558 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.31% chance of exploitation in the next 30 days (as of 2026-12-01).

### How serious is CVE-2026-40558?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2026-40558?

libnet \< 3.17; perl \>= 5.7.3, \<= 5.45.5.

### Is there a fix for CVE-2026-40558?

Yes. Fixed in libnet 3.17. Upgrade libnet to 3.17 or later. Vendor workaround: Install libnet 3.17 or later into your @INC include path, so it takes precedence over the vulnerable core module shipped with Perl.

### How do I check if I'm affected by CVE-2026-40558?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://github.com/steve-m-hay/perl-libnet/commit/4e5ce1cfa901a9bc2aad2b635b5434154983ff12.patch>
- other: <https://metacpan.org/release/SHAY/libnet-3.17/changes>
- other: <http://www.openwall.com/lists/oss-security/2026/11/29/7>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-40558>
- FIRST EPSS: EPSS scores by FIRST <https://www.first.org/epss/>

HTML: <https://flawdb.com/CVE-2026-40558> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-40558>
