CVE-2026-40558: Passive-mode data connection redirection in Perl Net::FTP
CVE-2026-40558 is a connection-redirection vulnerability in Net::FTP within Perl's libnet distribution. The Net::FTP::pasv() function trusts the IP address supplied in an FTP server's 227 passive-mode reply, allowing a malicious server to redirect the client's data connection to an arbitrary third-party host instead of the control-connection peer. This enables server-side request forgery through applications using the affected FTP client. Libnet 3.17 corrects the behavior by ignoring the advertised IP address and connecting the data channel to the control-connection peer.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
A malicious FTP server can cause an affected client to initiate data-channel connections to third-party hosts reachable from the client's network, potentially crossing network trust boundaries. Depending on the FTP operation and destination service, this can expose uploaded data to an unintended recipient or cause the client to receive attacker-directed data. The established primitive is data-connection redirection; arbitrary code execution is not established.
Mitigation
If you can’t patch tonight, do this now.
Until patched, prevent affected applications from connecting to untrusted FTP servers and restrict their outbound connectivity to approved destinations. Where feasible, enforce that passive FTP data connections use the same remote IP address as the control connection, blocking server-directed connections to unrelated hosts.
Remediation
Patch, then assume compromise.
Upgrade Perl's libnet distribution to version 3.17 or a vendor package containing the equivalent fix. The correction makes Net::FTP::pasv() ignore the IP address in the server's 227 reply and use the control-connection peer for the data channel. For Echo, update Perl and related packages to version 5.40.1-6+e21 or later. Fedora 45 users should apply the perl-libnet update associated with advisory FEDORA-2026-ada4328480. A fixed Debian package version is not identified in the available information.
Exploits
No public exploits tracked yet. Mallory keeps watching.
References
Frequently asked questions
- Is CVE-2026-40558 exploited in the wild?
- As of Nov 27, 2026, Mallory has no reports of CVE-2026-40558 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2026-40558?
- As of Nov 27, 2026, Mallory has found no public exploit for CVE-2026-40558.
- Is there a patch for CVE-2026-40558?
- Upgrade Perl's libnet distribution to version 3.17 or a vendor package containing the equivalent fix. The correction makes Net::FTP::pasv() ignore the IP address in the server's 227 reply and use the control-connection peer for the data channel.
Recent activity
6 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.