GHSA-r4m5-47cq-6qg8 Server-Side Request Forgery in ftp-srv

Not scored Published

Attackers can exploit SSRF in ftp-srv to access private network resources via the PORT command, requiring an upgrade to patched versions.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is GHSA-r4m5-47cq-6qg8?

GHSA-r4m5-47cq-6qg8 is a server-side request forgery vulnerability in ftp-srv, published on 4 Sep 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

All versions of ftp-srv from v1.0.0 onward to v4.3.3 are vulnerable to Server-Side Request Forgery (SSRF). The package fails to prevent remote clients to access other resources in the network, for example when connecting to the server through telnet. This allows attackers to access any network resources available to the server, including private resources in the hosting environment.

Recommendation

Upgrade to patched versions ^2.19.6, ^3.1.2, ^4.3.4

Workarounds

Blacklisting the FTP Command PORT will prevent the server from exposing this behaviour through active connections until a fix is applied.

const ftp = new FtpSrv({
  blacklist: ['PORT']
});

Which versions are affected by GHSA-r4m5-47cq-6qg8?

6 open source packages ship an affected version, including ftp-srv.

PackageAffectedFixed in
ftp-srv npmFrom 1.0.02.19.6
ftp-srv npmFrom 1.0.02.19.6
ftp-srv npmFrom 3.0.03.1.2
ftp-srv npmFrom 3.0.03.1.2
ftp-srv npmFrom 4.0.04.3.4
ftp-srv npmFrom 4.0.04.3.4

How do I fix GHSA-r4m5-47cq-6qg8?

Upgrade ftp-srv to a fixed version for your release line: 2.19.6, 3.1.2 or 4.3.4.

Upgrade, and send outbound requests through an allow-list that blocks internal addresses. More about Server-side request forgery.

Is GHSA-r4m5-47cq-6qg8 being exploited?

There is no known exploitation of GHSA-r4m5-47cq-6qg8 in the wild and no public exploit code.

Sources

Is GHSA-r4m5-47cq-6qg8 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free