CVE-2021-43803: Next Unexpected Server Crash Vulnerability

HIGH
Advisory Identifier: GHSA-25mp-g6fv-mqxx
CVSS 7.5
CWE-20
Published
Advisory Summary

CVE-2021-43803 is a HIGH (CVSS 7.5) unexpected server crash vulnerability (CWE-20: Improper Input Validation) affecting Next libraries in the npm ecosystem. The issue involves unexpected server crash in next.js.. Remediation is available by upgrading affected packages to version 12.0.5, 11.1.3.

CVE-2021-43803 at a Glance

CVE Identifier CVE-2021-43803
GHSA Identifier GHSA-25mp-g6fv-mqxx
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-20: Improper Input Validation
Affected Product Next
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

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:N/I:N/A:H).

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

How to Fix CVE-2021-43803

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: 12.0.5
npm install next@12.0.5
next fixed: 11.1.3
npm install next@11.1.3
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-2021-43803, 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.5), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. 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

Next.js is a React framework. In versions of Next.js prior to 12.0.5 or 11.1.3, invalid or malformed URLs could lead to a server crash. In order to be affected by this issue, the deployment must use Next.js versions above 11.1.0 and below 12.0.5, Node.js above 15.0.0, and next start or a custom server. Deployments on Vercel are not affected, along with similar environments where invalid requests are filtered before reaching Next.js. Versions 12.0.5 and 11.1.3 contain patches for this issue. Note that prior version 0.9.9 package `next` hosted a different utility (0.4.1 being the latest version of that codebase), and this advisory does not apply to those versions.

CVE-2021-43803 Affected Next Versions

2 component(s)
Fixed Versions:
12.0.511.1.3
Product / Package Ecosystem Affected Versions Fixed Version
next
npm
≥ 12.0.0
< 12.0.5
12.0.5
next
npm
≥ 0.9.9
< 11.1.3
11.1.3

References

Frequently Asked Questions

What is CVE-2021-43803?
CVE-2021-43803 is a security vulnerability in Next involving Unexpected server crash in Next.js. under CWE-20: Improper Input Validation.
Which Next versions are affected?
Affected versions include releases prior to 12.0.5, 11.1.3 across affected packages: next.
What version fixes CVE-2021-43803?
Upgrading to 12.0.5, 11.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is next affected?
Yes, next is affected in releases prior to 12.0.5, 11.1.3. Upgrade your dependency to 12.0.5, 11.1.3 or later.
What is the CVSS score of CVE-2021-43803?
CVE-2021-43803 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2021-43803?
CVE-2021-43803 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check npm dependencies for CVE-2021-43803?
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-25mp-g6fv-mqxx",
  "modified" : "2024-03-13T22:14:17Z",
  "published" : "2021-12-07T21:12:09Z",
  "aliases" : [ "CVE-2021-43803" ],
  "summary" : "Unexpected server crash in Next.js.",
  "details" : "Next.js is a React framework. In versions of Next.js prior to 12.0.5 or 11.1.3, invalid or malformed URLs could lead to a server crash. In order to be affected by this issue, the deployment must use Next.js versions above 11.1.0 and below 12.0.5, Node.js above 15.0.0, and next start or a custom server. Deployments on Vercel are not affected, along with similar environments where invalid requests are filtered before reaching Next.js. Versions 12.0.5 and 11.1.3 contain patches for this issue. Note that prior version 0.9.9 package `next` hosted a different utility (0.4.1 being the latest version of that codebase), and this advisory does not apply to those versions. ",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/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.5"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "next"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.9.9"
      }, {
        "fixed" : "11.1.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/security/advisories/GHSA-25mp-g6fv-mqxx"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-43803"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/pull/32080"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/commit/6d98b4fb4315dec1badecf0e9bdc212a4272b264"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/vercel/next.js"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/releases/tag/v11.1.3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/releases/v12.0.5"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-12-06T19:17:55Z",
    "nvd_published_at" : "2021-12-10T00:15:00Z"
  }
}