Vulnerabilities in pkg:npm/storybook

PACKAGE
Advisory Identifier: GHSA-mjf5-7g4m-gx5w
Advisory Summary

CVE-2026-27148 is a HIGH storybook dev server is vulnerable vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Storybook libraries in the npm ecosystem. The issue involves storybook dev server is vulnerable to websocket hijacking. Remediation is available by upgrading affected packages to version 8.6.17, 9.1.19, 10.2.10.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/storybook

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/storybook. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-mjf5-7g4m-gx5w CVE-2026-27148 HIGH Storybook Dev Server is Vulnerable to WebSocket Hijacking
GHSA-8452-54wp-rmv6 CVE-2025-68429 HIGH Storybook manager bundle may expose environment variables during build

CVE-2026-27148 at a Glance

CVE Identifier CVE-2026-27148
GHSA Identifier GHSA-mjf5-7g4m-gx5w
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Storybook
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-27148

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

storybook fixed: 8.6.17
npm install storybook@8.6.17
storybook fixed: 9.1.19
npm install storybook@9.1.19
storybook fixed: 10.2.10
npm install storybook@10.2.10
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 storybook

How to Check if You Are Affected

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

npm ls storybook

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

Note: The npm ls storybook 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 Storybook, 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

### Summary The WebSocket functionality in Storybook's dev server, used to create and update stories, is vulnerable to WebSocket hijacking. This vulnerability **only affects the Storybook dev server; production builds are not impacted**. ### Details Exploitation requires a developer to visit a malicious website while their local Storybook dev server is running. Because the WebSocket connection does not validate the origin of incoming connections, a malicious site can silently send WebSocket messages to the local instance without any further user interaction. If a Storybook dev server is intentionally exposed publicly (e.g. for design reviews or stakeholder demos) the risk is higher, as no malicious site visit is required. Any unauthenticated attacker can send WebSocket messages to it directly. The vulnerability affects the WebSocket message handlers for creating and saving stories, which can be exploited via unauthorized WebSocket connections to achieve persistent XSS or Remote Code Execution (RCE). _Note: recent versions of Chrome have some protections against this, but Firefox does not._ ### Impact This vulnerability can lead to supply chain compromise. Key risks include: - **Remote Code Execution**: The vulnerability can allow attackers to execute malicious code, with the extent of impact depending on the configuration. Server-side RCE is possible in non-default configurations, such as when stories are executed via portable stories in JSDOM, potentially allowing attackers to exfiltrate credentials and environment variables, access source code and the filesystem, establish backdoors, or pivot to internal network resources. - **Persistent XSS**: Malicious payloads are written directly into story source files. If the malicious payload is committed to version control, it becomes part of the codebase and can propagate to deployed Storybook documentation sites, affecting developers and stakeholders who view them. - **Supply Chain Propagation**: If the modified source files are committed, injected code can spread to other team members via git, execute in CI/CD pipelines, and affect shared component libraries used across multiple projects. ### Affected versions 8.1 and above. While the exploitable functionality was introduced in 8.1, the patch has been applied to 7.x as a precautionary measure given the underlying WebSocket behaviour. ### Recommended actions Update to one of the patched versions: `7.6.23`, `8.6.17`, `9.1.19`, `10.2.10`.

CVE-2026-27148 Affected Storybook Versions

3 component(s)
Fixed Versions:
8.6.179.1.1910.2.10
Product / Package Ecosystem Affected Versions Fixed Version
storybook
npm
≥ 8.1.0
< 8.6.17
8.6.17
storybook
npm
≥ 8.7.0-alpha.0
< 9.1.19
9.1.19
storybook
npm
≥ 10.0.0-beta.0
< 10.2.10
10.2.10

References

Frequently Asked Questions

What is CVE-2026-27148?
CVE-2026-27148 is a security vulnerability in Storybook involving Storybook Dev Server is Vulnerable to WebSocket Hijacking under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Storybook versions are affected?
Affected versions include releases prior to 8.6.17, 9.1.19, 10.2.10 across affected packages: storybook.
What version fixes CVE-2026-27148?
Upgrading to 8.6.17, 9.1.19, 10.2.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is storybook affected?
Yes, storybook is affected in releases prior to 8.6.17, 9.1.19, 10.2.10. Upgrade your dependency to 8.6.17, 9.1.19, 10.2.10 or later.
What CWE is associated with CVE-2026-27148?
CVE-2026-27148 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 CVE-2026-27148?
Run the dependency tree command: 'npm ls storybook'. 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-mjf5-7g4m-gx5w",
  "modified" : "2026-02-26T15:16:10Z",
  "published" : "2026-02-26T15:16:10Z",
  "aliases" : [ "CVE-2026-27148" ],
  "summary" : "Storybook Dev Server is Vulnerable to WebSocket Hijacking",
  "details" : "### Summary\n\nThe WebSocket functionality in Storybook's dev server, used to create and update stories, is vulnerable to WebSocket hijacking. This vulnerability **only affects the Storybook dev server; production builds are not impacted**.\n\n### Details\n\nExploitation requires a developer to visit a malicious website while their local Storybook dev server is running. Because the WebSocket connection does not validate the origin of incoming connections, a malicious site can silently send WebSocket messages to the local instance without any further user interaction.\n\nIf a Storybook dev server is intentionally exposed publicly (e.g. for design reviews or stakeholder demos) the risk is higher, as no malicious site visit is required. Any unauthenticated attacker can send WebSocket messages to it directly.\n\nThe vulnerability affects the WebSocket message handlers for creating and saving stories, which can be exploited via unauthorized WebSocket connections to achieve persistent XSS or Remote Code Execution (RCE).\n\n_Note: recent versions of Chrome have some protections against this, but Firefox does not._\n\n### Impact\nThis vulnerability can lead to supply chain compromise. Key risks include:\n\n- **Remote Code Execution**: The vulnerability can allow attackers to execute malicious code, with the extent of impact depending on the configuration. Server-side RCE is possible in non-default configurations, such as when stories are executed via portable stories in JSDOM, potentially allowing attackers to exfiltrate credentials and environment variables, access source code and the filesystem, establish backdoors, or pivot to internal network resources.\n- **Persistent XSS**: Malicious payloads are written directly into story source files. If the malicious payload is committed to version control, it becomes part of the codebase and can propagate to deployed Storybook documentation sites, affecting developers and stakeholders who view them.\n- **Supply Chain Propagation**: If the modified source files are committed, injected code can spread to other team members via git, execute in CI/CD pipelines, and affect shared component libraries used across multiple projects.\n\n### Affected versions\n\n8.1 and above. While the exploitable functionality was introduced in 8.1, the patch has been applied to 7.x as a precautionary measure given the underlying WebSocket behaviour.\n\n### Recommended actions\nUpdate to one of the patched versions: `7.6.23`, `8.6.17`, `9.1.19`, `10.2.10`.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "storybook"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.1.0"
      }, {
        "fixed" : "8.6.17"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "storybook"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.7.0-alpha.0"
      }, {
        "fixed" : "9.1.19"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "storybook"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "10.0.0-beta.0"
      }, {
        "fixed" : "10.2.10"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/storybookjs/storybook/security/advisories/GHSA-mjf5-7g4m-gx5w"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27148"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/storybookjs/storybook/commit/0affdf928bd6fafbadfb1dfe22ce6104805e10e8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/storybookjs/storybook/commit/54689a8add18ea75d628c540f4bc677592a1e685"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/storybookjs/storybook/commit/b8cfa77c73940c140acdcd8a06ab1ea913c44761"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/storybookjs/storybook/commit/d34085f39c647f5c23c3a3b2d197c18602fcf876"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/storybookjs/storybook"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/storybookjs/storybook/releases/tag/v10.2.10"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/storybookjs/storybook/releases/tag/v7.6.23"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/storybookjs/storybook/releases/tag/v8.6.17"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/storybookjs/storybook/releases/tag/v9.1.19"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1385", "CWE-74", "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-02-26T15:16:10Z",
    "nvd_published_at" : "2026-02-25T22:16:25Z"
  }
}