CVE-2020-15152: Ftp srv Server-Side Request Forgery Vulnerability

CRITICAL
Advisory Identifier: GHSA-jw37-5gqr-cf9j
CVSS 9.1
CWE-918
Published
Advisory Summary

CVE-2020-15152 is a CRITICAL (CVSS 9.1) server-side request forgery vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Ftp srv libraries in the npm ecosystem. The issue involves server-side request forgery in ftp-srv. Remediation is available by upgrading affected packages to version 2.19.6, 3.1.2, 4.3.4.

CVE-2020-15152 at a Glance

CVE Identifier CVE-2020-15152
GHSA Identifier GHSA-jw37-5gqr-cf9j
Severity CRITICAL
CVSS v3.1 Base Score 9.1
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Ftp srv
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2020-15152

To remediate this vulnerability, upgrade all affected Ftp srv dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

ftp-srv fixed: 2.19.6
npm install ftp-srv@2.19.6
ftp-srv fixed: 3.1.2
npm install ftp-srv@3.1.2
ftp-srv fixed: 4.3.4
npm install ftp-srv@4.3.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls ftp-srv

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2020-15152, inspect your project dependencies using npm:

npm ls ftp-srv

Analyze the terminal output to locate any version of Ftp srv in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.19.6), your application is affected.

Note: The npm ls ftp-srv command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Ftp srv, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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. ```js 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: * Open an issue at [https://github.com/autovance/ftp-srv](https://github.com/autovance/ftp-srv) * Email us directly; security@autovance.com

CVE-2020-15152 Affected Ftp srv Versions

3 component(s)
Fixed Versions:
2.19.63.1.24.3.4
Product / Package Ecosystem Affected Versions Fixed Version
ftp-srv
npm
≥ 1.0.0
< 2.19.6
2.19.6
ftp-srv
npm
≥ 3.0.0
< 3.1.2
3.1.2
ftp-srv
npm
≥ 4.0.0
< 4.3.4
4.3.4

References

Frequently Asked Questions

What is CVE-2020-15152?
CVE-2020-15152 is a security vulnerability in Ftp srv involving Server-Side Request Forgery in ftp-srv under CWE-918: Server-Side Request Forgery (SSRF).
Which Ftp srv versions are affected?
Affected versions include releases prior to 2.19.6, 3.1.2, 4.3.4 across affected packages: ftp-srv.
What version fixes CVE-2020-15152?
Upgrading to 2.19.6, 3.1.2, 4.3.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ftp-srv affected?
Yes, ftp-srv is affected in releases prior to 2.19.6, 3.1.2, 4.3.4. Upgrade your dependency to 2.19.6, 3.1.2, 4.3.4 or later.
What is the CVSS score of CVE-2020-15152?
CVE-2020-15152 has a CVSS v3.1 base score of 9.1 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2020-15152?
CVE-2020-15152 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check npm dependencies for CVE-2020-15152?
Run the dependency tree command: 'npm ls ftp-srv'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-jw37-5gqr-cf9j",
  "modified" : "2021-01-12T19:30:42Z",
  "published" : "2020-08-17T21:44:54Z",
  "aliases" : [ "CVE-2020-15152" ],
  "summary" : "Server-Side Request Forgery in ftp-srv",
  "details" : "### Background\n\nThe FTP protocol creates two connections, one for commands and one for transferring data.\nThis 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.\n\nThe PORT command sends the IP and port for the server to connect to the client with.\n\n### Issue\nSince the client can send an arbitrary IP with the PORT command, this can be used to cause the server to make a connection elsewhere.\n\n### Patches\n\n* _fix: disallow PORT connections to alternate hosts_: e449e75219d918c400dec65b4b0759f60476abca\n\nDeprecation notices have been published for older versions.\n\n### Workarounds\n\nBlacklisting the FTP Command `PORT` will prevent the server from exposing this behaviour through active connections until a fix is applied.\n```js\nconst ftp = new FtpSrv({\n  blacklist: ['PORT']\n});\n```\n\n### References\nhttps://www.npmjs.com/advisories/1445\n\n### Credits\n\nThank you to;\n@trs for fixing it\n@andreeleuterio for reporting it to us for an anonymous user (Vincent) through the NPM platform\n@quiquelhappy for bringing it to our attention after it slipped through the cracks during Christmas\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue at [https://github.com/autovance/ftp-srv](https://github.com/autovance/ftp-srv)\n* Email us directly; security@autovance.com",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "ftp-srv"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "2.19.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "ftp-srv"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.1.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "ftp-srv"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.3.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/autovance/ftp-srv/security/advisories/GHSA-jw37-5gqr-cf9j"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-15152"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/autovance/ftp-srv/commit/5508c2346cf23b24c20070ff2e8a47c647d3d5b5"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/autovance/ftp-srv/commit/e449e75219d918c400dec65b4b0759f60476abca"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/autovance/ftp-srv/commit/fb32b012c3baf48ee804e1dc36544cbba70b00d3"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/1445"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/ftp-srv"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-17T21:42:37Z",
    "nvd_published_at" : "2020-08-17T22:15:00Z"
  }
}