CVE-2022-21721: Next Denial of Service Vulnerability
MODERATECVE-2022-21721 is a MODERATE (CVSS 5.9) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Next libraries in the npm ecosystem. The issue involves denial of service vulnerability in next.js. Remediation is available by upgrading affected packages to version 12.0.9.
CVE-2022-21721 at a Glance
Security Impact
CVSS: 5.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2022-21721
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@12.0.9
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-2022-21721, 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 12.0.9), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. 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-2022-21721 Affected Next Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
next
|
npm |
≥ 12.0.0
< 12.0.9
|
12.0.9
|
References
Frequently Asked Questions
What is CVE-2022-21721?
Which Next versions are affected?
What version fixes CVE-2022-21721?
Is next affected?
What is the CVSS score of CVE-2022-21721?
What CWE is associated with CVE-2022-21721?
How can I check npm dependencies for CVE-2022-21721?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wr66-vrwm-5g5x",
"modified" : "2022-02-07T21:17:29Z",
"published" : "2022-01-28T23:09:22Z",
"aliases" : [ "CVE-2022-21721" ],
"summary" : "Denial of Service Vulnerability in next.js",
"details" : "### Impact\n\nVulnerable code could allow a bad actor to trigger a denial of service attack for anyone running a Next.js app at version >= 12.0.0, and using i18n functionality.\n\n- **Affected:** All of the following must be true to be affected by this CVE\n - Next.js versions above v12.0.0\n - Using next start or a custom server\n - Using the built-in i18n support\n- **Not affected:**\n - Deployments on Vercel (vercel.com) are not affected along with similar environments where invalid requests are filtered before reaching Next.js.\n\n### Patches\n\nA patch has been released, `next@12.0.9`, that mitigates this issue. We recommend all affected users upgrade as soon as possible.\n\n### Workarounds\n\nWe recommend upgrading whether you can reproduce or not although you can ensure `/${locale}/_next/` is blocked from reaching the Next.js instance until you upgrade.\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [next](https://github.com/vercel/next.js)\n* Email us at [security@vercel.com](mailto:security@vercel.com)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "next"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "12.0.0"
}, {
"fixed" : "12.0.9"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/vercel/next.js/security/advisories/GHSA-wr66-vrwm-5g5x"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-21721"
}, {
"type" : "WEB",
"url" : "https://github.com/vercel/next.js/pull/33503"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/vercel/next.js"
}, {
"type" : "WEB",
"url" : "https://github.com/vercel/next.js/releases/tag/v12.0.9"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-400" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-01-28T18:52:54Z",
"nvd_published_at" : "2022-01-28T22:15:00Z"
}
}