CVE-2020-5284: Next Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-fq77-7p7r-83rj
CVSS 4.4
CWE-23
Published
Advisory Summary

CVE-2020-5284 is a MODERATE (CVSS 4.4) path traversal vulnerability (CWE-23: Relative Path Traversal) affecting Next libraries in the npm ecosystem. The issue involves directory traversal in next.js. Remediation is available by upgrading affected packages to version 9.3.2.

CVE-2020-5284 at a Glance

CVE Identifier CVE-2020-5284
GHSA Identifier GHSA-fq77-7p7r-83rj
Severity MODERATE
CVSS v3.1 Base Score 4.4
CWE Classification CWE-23: Relative Path Traversal
Affected Product Next
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 4.4

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

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

How to Fix CVE-2020-5284

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

next fixed: 9.3.2
npm install next@9.3.2
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 next

How to Check if You Are Affected

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

npm ls next

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

Note: The npm ls next 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-23: Relative Path Traversal, where the product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory. In Next, 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

### Impact - **Not affected**: Deployments on ZEIT Now v2 ([https://zeit.co](https://zeit.co/)) are not affected - **Not affected**: Deployments using the `serverless` target - **Not affected**: Deployments using `next export` - **Affected**: Users of Next.js below 9.3.2 We recommend everyone to upgrade regardless of whether you can reproduce the issue or not. ### Patches https://github.com/zeit/next.js/releases/tag/v9.3.2 ### References https://github.com/zeit/next.js/releases/tag/v9.3.2

CVE-2020-5284 Affected Next Versions

1 component(s)
Fixed Versions:
9.3.2
Product / Package Ecosystem Affected Versions Fixed Version
next
npm
≥ 0.9.9
< 9.3.2
9.3.2

References

Frequently Asked Questions

What is CVE-2020-5284?
CVE-2020-5284 is a security vulnerability in Next involving Directory Traversal in Next.js under CWE-23: Relative Path Traversal.
Which Next versions are affected?
Affected versions include releases prior to 9.3.2 across affected packages: next.
What version fixes CVE-2020-5284?
Upgrading to 9.3.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is next affected?
Yes, next is affected in releases prior to 9.3.2. Upgrade your dependency to 9.3.2 or later.
What is the CVSS score of CVE-2020-5284?
CVE-2020-5284 has a CVSS v3.1 base score of 4.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2020-5284?
CVE-2020-5284 is classified under CWE-23: Relative Path Traversal (The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory.).
How can I check npm dependencies for CVE-2020-5284?
Run the dependency tree command: 'npm ls next'. 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-fq77-7p7r-83rj",
  "modified" : "2025-09-26T17:49:56Z",
  "published" : "2020-03-30T20:40:50Z",
  "aliases" : [ "CVE-2020-5284" ],
  "summary" : "Directory Traversal in Next.js",
  "details" : "### Impact\n\n- **Not affected**: Deployments on ZEIT Now v2 ([https://zeit.co](https://zeit.co/)) are not affected\n- **Not affected**: Deployments using the `serverless` target\n- **Not affected**: Deployments using `next export`\n- **Affected**: Users of Next.js below 9.3.2\n\nWe recommend everyone to upgrade regardless of whether you can reproduce the issue or not.\n\n### Patches\n\nhttps://github.com/zeit/next.js/releases/tag/v9.3.2\n\n### References\n\nhttps://github.com/zeit/next.js/releases/tag/v9.3.2",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "next"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.9.9"
      }, {
        "fixed" : "9.3.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/zeit/next.js/security/advisories/GHSA-fq77-7p7r-83rj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-5284"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zeit/next.js/releases/tag/v9.3.2"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/1503"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-23" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-03-30T20:40:39Z",
    "nvd_published_at" : null
  }
}