CVE-2020-15152: Ftp srv Server-Side Request Forgery Vulnerability
CRITICALCVE-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
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).
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.
npm install ftp-srv@2.19.6
npm install ftp-srv@3.1.2
npm install ftp-srv@4.3.4
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
CVE-2020-15152 Affected Ftp srv Versions
3 component(s)| 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?
Which Ftp srv versions are affected?
What version fixes CVE-2020-15152?
Is ftp-srv affected?
What is the CVSS score of CVE-2020-15152?
What CWE is associated with CVE-2020-15152?
How can I check npm dependencies for CVE-2020-15152?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}