CVE-2020-5284: Next Path Traversal Vulnerability
MODERATECVE-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
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).
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.
npm install next@9.3.2
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
CVE-2020-5284 Affected Next Versions
1 component(s)| 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?
Which Next versions are affected?
What version fixes CVE-2020-5284?
Is next affected?
What is the CVSS score of CVE-2020-5284?
What CWE is associated with CVE-2020-5284?
How can I check npm dependencies for CVE-2020-5284?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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
}
}