CVE-2022-36046: Next Unexpected Server Crash Vulnerability

MODERATE
Advisory Identifier: GHSA-wff4-fpwg-qqv3
CVSS 5.3
CWE-754 CWE-248
Published
Advisory Summary

CVE-2022-36046 is a MODERATE (CVSS 5.3) unexpected server crash vulnerability (CWE-754: Improper Check for Unusual or Exceptional Conditions) 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.2.4.

CVE-2022-36046 at a Glance

CVE Identifier CVE-2022-36046
GHSA Identifier GHSA-wff4-fpwg-qqv3
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-754: Improper Check for Unusual or Exceptional Conditions
Affected Product Next
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.3

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

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
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-2022-36046

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.2.4
npm install next@12.2.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 next

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2022-36046, 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.2.4), 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-754: Improper Check for Unusual or Exceptional Conditions, where the product does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the product. 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 When specific requests are made to the Next.js server it can cause an `unhandledRejection` in the server which can crash the process to exit in specific Node.js versions with strict `unhandledRejection` handling. - Affected: All of the following must be true to be affected by this CVE - Node.js version above v15.0.0 being used with strict `unhandledRejection` exiting - Next.js version v12.2.3 - Using next start or a [custom server](https://nextjs.org/docs/advanced-features/custom-server) - Not affected: Deployments on Vercel ([vercel.com](https://vercel.com/)) are not affected along with similar environments where `next-server` isn't being shared across requests. ### Patches https://github.com/vercel/next.js/releases/tag/v12.2.4

CVE-2022-36046 Affected Next Versions

1 component(s)
Fixed Versions:
12.2.4
Product / Package Ecosystem Affected Versions Fixed Version
next
npm
≥ 12.2.3
< 12.2.4
All 1 versions
12.2.3
12.2.4

References

Frequently Asked Questions

What is CVE-2022-36046?
CVE-2022-36046 is a security vulnerability in Next involving Unexpected server crash in Next.js under CWE-754: Improper Check for Unusual or Exceptional Conditions.
Which Next versions are affected?
Affected versions include releases prior to 12.2.4 across affected packages: next.
What version fixes CVE-2022-36046?
Upgrading to 12.2.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is next affected?
Yes, next is affected in releases prior to 12.2.4. Upgrade your dependency to 12.2.4 or later.
What is the CVSS score of CVE-2022-36046?
CVE-2022-36046 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2022-36046?
CVE-2022-36046 is classified under CWE-754: Improper Check for Unusual or Exceptional Conditions (The product does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the product.).
How can I check npm dependencies for CVE-2022-36046?
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-wff4-fpwg-qqv3",
  "modified" : "2022-09-08T14:17:38Z",
  "published" : "2022-08-30T20:38:34Z",
  "aliases" : [ "CVE-2022-36046" ],
  "summary" : "Unexpected server crash in Next.js",
  "details" : "### Impact\n\nWhen specific requests are made to the Next.js server it can cause an `unhandledRejection` in the server which can crash the process to exit in specific Node.js versions with strict `unhandledRejection` handling. \n\n- Affected: All of the following must be true to be affected by this CVE\n  - Node.js version above v15.0.0 being used with strict `unhandledRejection` exiting\n  - Next.js version v12.2.3\n  - Using next start or a [custom server](https://nextjs.org/docs/advanced-features/custom-server)\n \n- Not affected: Deployments on Vercel ([vercel.com](https://vercel.com/)) are not affected along with similar environments where `next-server` isn't being shared across requests.\n\n### Patches\nhttps://github.com/vercel/next.js/releases/tag/v12.2.4\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "next"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "12.2.3"
      }, {
        "fixed" : "12.2.4"
      } ]
    } ],
    "versions" : [ "12.2.3" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/security/advisories/GHSA-wff4-fpwg-qqv3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-36046"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/vercel/next.js/releases/tag/v12.2.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-248", "CWE-754" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-08-30T20:38:34Z",
    "nvd_published_at" : "2022-08-31T19:15:00Z"
  }
}