Perl Net::FTP SSRF affects libnet releases before 3.17 when a client uses a hostile FTP server’s passive mode response. CPAN Security Group says the server can steer the client’s data connection to another host and port, including an internal service reachable from that client. Upgrade to libnet 3.17 or later and verify which copy of Net::FTP the application loads.
The group’s 29 November 2026 disclosure assigns CVE-2026-40558 to the flaw. Perl distributions from 5.7.3 through 5.45.5 also carry the affected module, according to the disclosure. A vulnerability intelligence platform can help place this advisory alongside the team’s software inventory and remediation record.
How Does Perl Net::FTP SSRF Reach Internal Services?
In passive FTP, the server gives the client connection details for a separate data channel. Before libnet 3.17, Net::FTP used the IP address in the server’s PASV reply without comparing it with the control connection’s peer. A malicious server could therefore make the client open a TCP connection toward a third-party destination reachable from its network.
This exposure matters when an application using the affected module connects to an untrusted or compromised FTP server. The possible destination depends on the client’s own network reachability and outbound rules. The advisory describes the connection primitive; it does not establish that a particular internal service was accessed.
| Distribution | Affected scope | Defensive action |
|---|---|---|
| libnet | Before 3.17 | Upgrade to 3.17 or later |
| Perl bundled Net::FTP | Perl 5.7.3 through 5.45.5 | Install libnet 3.17 or later ahead of the bundled module in @INC |
The libnet 3.17 change log dates the release to 21 November 2026. It says Net::FTP now ignores the IP address in the PASV reply and connects the data channel to the control connection’s peer. CPAN Security Group gives the @INC ordering as a workaround for affected Perl distributions.
What Should Defenders Do Now?
Start with applications that use Net::FTP to retrieve data from external FTP servers. Record the version and path of the Net::FTP module each production process actually loads. A newer package on disk is insufficient if the process still selects an older bundled copy.
- Find FTP clientsIdentify production jobs using Perl Net::FTP and their server destinations.
- Check the loaded moduleRecord the effective libnet version and Net::FTP path for each runtime.
- Apply the fixUpgrade libnet to 3.17 or later; check @INC priority when Perl bundles an older copy.
- Verify connectionsConfirm the updated process loads the fixed module and review permitted outbound destinations.
Review outbound connection logs for FTP data connections whose destination differs from the control connection’s peer. This is our detection suggestion based on the documented failure mode, not a reported attack pattern. Restrict client egress to approved destinations where operationally possible, then test legitimate transfers after changing the rule.
Network segmentation can limit which internal services an FTP client can reach. Keep the upgrade in the vulnerability management process until the running module and egress policy have both been checked. The code fix addresses the PASV redirection path, while network controls reduce the reach of any affected client.
From 1 September through 30 November 2026, Brandefense Blackhole recorded 513 dark chat posts matching Perl. This is a broad Perl topic count, not a CVE-specific measure or evidence of exploitation. It should not change the priority of verifying the module version and network path.
Frequently Asked Questions
Which libnet version fixes CVE-2026-40558?
CPAN Security Group says to upgrade to libnet 3.17 or later. Confirm the application loads that version, especially when Perl also bundles Net::FTP.
Does upgrading the Perl interpreter alone resolve this flaw?
The disclosure gives no fixed Perl interpreter release. For affected Perl distributions, it says to install libnet 3.17 or later earlier in @INC than the bundled module.
