Vulnerabilities in pkg:npm/ftp-srv

PACKAGE
Advisory Summary

GHSA-r4m5-47cq-6qg8 is a HIGH 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.

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/ftp-srv

3 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/ftp-srv. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-r4m5-47cq-6qg8 - HIGH Server-Side Request Forgery in ftp-srv
GHSA-pmw4-jgxx-pcq9 CVE-2020-26299 MODERATE File System Bounds Escape
GHSA-jw37-5gqr-cf9j CVE-2020-15152 CRITICAL Server-Side Request Forgery in ftp-srv

GHSA-r4m5-47cq-6qg8 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-r4m5-47cq-6qg8
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Ftp srv
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-r4m5-47cq-6qg8

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 GHSA-r4m5-47cq-6qg8, 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

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

GHSA-r4m5-47cq-6qg8 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 GHSA-r4m5-47cq-6qg8?
GHSA-r4m5-47cq-6qg8 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 GHSA-r4m5-47cq-6qg8?
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 CWE is associated with GHSA-r4m5-47cq-6qg8?
GHSA-r4m5-47cq-6qg8 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 GHSA-r4m5-47cq-6qg8?
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-r4m5-47cq-6qg8",
  "modified" : "2024-01-08T21:29:30Z",
  "published" : "2020-09-04T17:25:13Z",
  "aliases" : [ ],
  "summary" : "Server-Side Request Forgery in ftp-srv",
  "details" : "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.\n\n\n## Recommendation\n\nUpgrade to patched versions\n`^2.19.6, ^3.1.2, ^4.3.4`\n\n## Workarounds\nBlacklisting the FTP Command PORT will prevent the server from exposing this behaviour through active connections until a fix is applied.\n\n```\nconst ftp = new FtpSrv({\n  blacklist: ['PORT']\n});\n```",
  "severity" : [ ],
  "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/QuorumDMS/ftp-srv/security/advisories/GHSA-jw37-5gqr-cf9j"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/QuorumDMS/ftp-srv"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/1445"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-31T18:59:34Z",
    "nvd_published_at" : null
  }
}