Skip to content

Server-Side Request Forgery in ftp-srv

Critical severity GitHub Reviewed Published Aug 17, 2020 in QuorumDMS/ftp-srv • Updated Feb 1, 2023

Package

npm ftp-srv (npm)

Affected versions

>= 1.0.0, < 2.19.6
>= 3.0.0, < 3.1.2
>= 4.0.0, < 4.3.4

Patched versions

2.19.6
3.1.2
4.3.4

Description

Background

The FTP protocol creates two connections, one for commands and one for transferring data.
This second data connection can be created in two ways, on the server by sending the PASV command, or on the client by sending the PORT command.

The PORT command sends the IP and port for the server to connect to the client with.

Issue

Since the client can send an arbitrary IP with the PORT command, this can be used to cause the server to make a connection elsewhere.

Patches

  • fix: disallow PORT connections to alternate hosts: e449e75219d918c400dec65b4b0759f60476abca

Deprecation notices have been published for older versions.

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']
});

References

https://www.npmjs.com/advisories/1445

Credits

Thank you to;
@trs for fixing it
@andreeleuterio for reporting it to us for an anonymous user (Vincent) through the NPM platform
@quiquelhappy for bringing it to our attention after it slipped through the cracks during Christmas

For more information

If you have any questions or comments about this advisory:

References

@matt-forster matt-forster published to QuorumDMS/ftp-srv Aug 17, 2020
Reviewed Aug 17, 2020
Published to the GitHub Advisory Database Aug 17, 2020
Published by the National Vulnerability Database Aug 17, 2020
Last updated Feb 1, 2023

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

EPSS score

0.320%
(71st percentile)

Weaknesses

CVE ID

CVE-2020-15152

GHSA ID

GHSA-jw37-5gqr-cf9j

Source code

No known source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.