CVE-2023-28154: Webpack Cross-realm Object Access Vulnerability

CRITICAL
Advisory Identifier: GHSA-hc6q-2mpp-qw7j
CVSS 9.8
Published
Advisory Summary

CVE-2023-28154 is a CRITICAL (CVSS 9.8) cross-realm object access vulnerability (General Security Weakness) affecting Webpack libraries in the npm ecosystem. The issue involves cross-realm object access in webpack 5. Remediation is available by upgrading affected packages to version 5.76.0.

CVE-2023-28154 at a Glance

CVE Identifier CVE-2023-28154
GHSA Identifier GHSA-hc6q-2mpp-qw7j
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification General Security Weakness
Affected Product Webpack
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.8

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:H/I:H/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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2023-28154

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

webpack fixed: 5.76.0
npm install webpack@5.76.0
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 webpack

How to Check if You Are Affected

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

npm ls webpack

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

Note: The npm ls webpack 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 General Security Weakness. In Webpack, 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

Webpack 5 before 5.76.0 does not avoid cross-realm object access. ImportParserPlugin.js mishandles the magic comment feature. An attacker who controls a property of an untrusted object can obtain access to the real global object.

CVE-2023-28154 Affected Webpack Versions

1 component(s)
Fixed Versions:
5.76.0
Product / Package Ecosystem Affected Versions Fixed Version
webpack
npm
≥ 5.0.0
< 5.76.0
5.76.0

References

Frequently Asked Questions

What is CVE-2023-28154?
CVE-2023-28154 is a security vulnerability in Webpack involving Cross-realm object access in Webpack 5 under General Security Weakness.
Which Webpack versions are affected?
Affected versions include releases prior to 5.76.0 across affected packages: webpack.
What version fixes CVE-2023-28154?
Upgrading to 5.76.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is webpack affected?
Yes, webpack is affected in releases prior to 5.76.0. Upgrade your dependency to 5.76.0 or later.
What is the CVSS score of CVE-2023-28154?
CVE-2023-28154 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-28154?
CVE-2023-28154 is classified under General Security Weakness.
How can I check npm dependencies for CVE-2023-28154?
Run the dependency tree command: 'npm ls webpack'. 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-hc6q-2mpp-qw7j",
  "modified" : "2023-10-30T13:11:24Z",
  "published" : "2023-03-13T03:30:15Z",
  "aliases" : [ "CVE-2023-28154" ],
  "summary" : "Cross-realm object access in Webpack 5",
  "details" : "Webpack 5 before 5.76.0 does not avoid cross-realm object access. ImportParserPlugin.js mishandles the magic comment feature. An attacker who controls a property of an untrusted object can obtain access to the real global object.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "webpack"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.76.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-28154"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/webpack/webpack/pull/16500"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/webpack/webpack/compare/v5.75.0...v5.76.0"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AU7BOXTBK3KDYSWH67ASZ22TUIOZ3X5G"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PPSAXUTXBCCTAHTCX5BUR4YVP25XALQ3"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/U2AFCM6FFE3LRYI6KNEQWKMXMQOBZQ2D"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-03-14T15:03:08Z",
    "nvd_published_at" : "2023-03-13T01:15:00Z"
  }
}