Vulnerabilities in pkg:npm/webpack-bundle-analyzer

PACKAGE
Advisory Summary

GHSA-pgr8-jg6h-8gw6 is a MODERATE (CVSS 6.3) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Webpack bundle analyzer libraries in the npm ecosystem. The issue involves cross-site scripting in webpack-bundle-analyzer. Remediation is available by upgrading affected packages to version 3.3.2.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/webpack-bundle-analyzer

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/webpack-bundle-analyzer. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-pgr8-jg6h-8gw6 - MODERATE Cross-Site Scripting in webpack-bundle-analyzer

GHSA-pgr8-jg6h-8gw6 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-pgr8-jg6h-8gw6
Severity MODERATE
CVSS v3.1 Base Score 6.3
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Webpack bundle analyzer
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.3

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

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

How to Fix GHSA-pgr8-jg6h-8gw6

To remediate this vulnerability, upgrade all affected Webpack bundle analyzer 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-bundle-analyzer fixed: 3.3.2
npm install webpack-bundle-analyzer@3.3.2
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-bundle-analyzer

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-pgr8-jg6h-8gw6, inspect your project dependencies using npm:

npm ls webpack-bundle-analyzer

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

Note: The npm ls webpack-bundle-analyzer 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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Webpack bundle analyzer, 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

Versions of `webpack-bundle-analyzer` prior to 3.3.2 are vulnerable to Cross-Site Scripting. The package uses `JSON.stringify()` without properly escaping input which may lead to Cross-Site Scripting. ## Recommendation Upgrade to version 3.3.2 or later.

GHSA-pgr8-jg6h-8gw6 Affected Webpack bundle analyzer Versions

1 component(s)
Fixed Versions:
3.3.2
Product / Package Ecosystem Affected Versions Fixed Version
webpack-bundle-analyzer
npm
< 3.3.2
3.3.2

References

Frequently Asked Questions

What is GHSA-pgr8-jg6h-8gw6?
GHSA-pgr8-jg6h-8gw6 is a security vulnerability in Webpack bundle analyzer involving Cross-Site Scripting in webpack-bundle-analyzer under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Webpack bundle analyzer versions are affected?
Affected versions include releases prior to 3.3.2 across affected packages: webpack-bundle-analyzer.
What version fixes GHSA-pgr8-jg6h-8gw6?
Upgrading to 3.3.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is webpack-bundle-analyzer affected?
Yes, webpack-bundle-analyzer is affected in releases prior to 3.3.2. Upgrade your dependency to 3.3.2 or later.
What is the CVSS score of GHSA-pgr8-jg6h-8gw6?
GHSA-pgr8-jg6h-8gw6 has a CVSS v3.1 base score of 6.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L.
What CWE is associated with GHSA-pgr8-jg6h-8gw6?
GHSA-pgr8-jg6h-8gw6 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for GHSA-pgr8-jg6h-8gw6?
Run the dependency tree command: 'npm ls webpack-bundle-analyzer'. 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-pgr8-jg6h-8gw6",
  "modified" : "2021-08-04T15:26:36Z",
  "published" : "2019-05-23T09:26:20Z",
  "aliases" : [ ],
  "summary" : "Cross-Site Scripting in webpack-bundle-analyzer",
  "details" : "Versions of `webpack-bundle-analyzer` prior to 3.3.2 are vulnerable to Cross-Site Scripting. The package uses `JSON.stringify()` without properly escaping input which may lead to Cross-Site Scripting.\n\n\n## Recommendation\n\nUpgrade to version 3.3.2 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "webpack-bundle-analyzer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.3.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/webpack-contrib/webpack-bundle-analyzer/issues/263"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/264"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/webpack-contrib/webpack-bundle-analyzer/commit/20f2b4c553ee343f491faf63e39427fba9908c7c"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-WEBPACKBUNDLEANALYZER-174190"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/826"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2019-05-23T07:34:50Z",
    "nvd_published_at" : null
  }
}