Perl Net::FTP Flaw CVE-2026-40558 Allows Server-Side Request Forgery
According to oss-security, the CPAN Security Group has published advisory CVE-2026-40558 for the Net::FTP module in Perl. The flaw affects libnet before 3.17 and Perl releases that bundle the vulnerable module.
WebVulnerabilitiesKey points
- CVE-2026-40558 affects the Net::FTP module in libnet before 3.17, and Perl 5.7.3 through 5.45.5 because it bundles that module.
- In passive mode, the client does not verify the data-connection address from the server's 227 reply against the control connection.
- A malicious FTP server could make the client connect to internal hosts and ports, classified as CWE-918.
- The advisory recommends libnet 3.17 or later; no severity score or exploitation status is given.
According to oss-security, the CPAN Security Group has published advisory CVE-2026-40558 for the Net::FTP module in Perl. The flaw sits in the libnet distribution, which is affected in all versions before 3.17. The advisory also lists Perl itself, from 5.7.3 through 5.45.5, because Perl bundles the vulnerable libnet module.
The problem involves passive mode. The client takes the address it receives in the server's 227 reply and uses it for the data connection without checking that address against the control connection. According to the advisory, a malicious FTP server could therefore cause the client to open outbound TCP connections to hosts and ports the server selects. That can include internal systems that only the client can reach. The advisory classifies the issue as server-side request forgery, CWE-918.
The recommended fix is to upgrade to libnet 3.17 or later. As a vendor-side workaround, the advisory says a newer libnet can be installed in a location on the @INC path so that it takes precedence over the bundled core module. A patch commit in the upstream libnet GitHub repository and the 3.17 release changelog are referenced.
The report does not give a severity score and does not say whether the flaw is being exploited. Readers can consult the original oss-security report for full details.
What to do
- Upgrade libnet to version 3.17 or later.
- Where the bundled module cannot be replaced directly, install libnet 3.17 or later in a location on the @INC path so it takes precedence over the core module, as the advisory describes.
- Identify Perl installations in the 5.7.3 to 5.45.5 range that rely on the bundled libnet.
- Review the upstream patch commit and the 3.17 changelog referenced by the advisory.
Original report
“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”
Posted by Robert Rothenberg on Nov 29 ======================================================================== CVE-2026-40558 CPAN Security Group ======================================================================== CVE ID: CVE-2026-40558 Distribution: libnet Versions: before 3.17 MetaCPAN: https://metacpan.org/dist/libnet VCS Repo: ...