Skip to content

Update dependency storybook to v9.1.21 [SECURITY] - #451

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-storybook-vulnerability
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-storybook-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Jan 28, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
storybook (source) 9.1.2 → 9.1.21 age confidence

Storybook manager bundle may expose environment variables during build

CVE-2025-68429 / GHSA-8452-54wp-rmv6

More information

Details

On December 11th, the Storybook team received a responsible disclosure alerting them to a potential vulnerability in certain built and published Storybooks.

The vulnerability is a bug in how Storybook handles environment variables defined in a .env file, which could, in specific circumstances, lead to those variables being unexpectedly bundled into the artifacts created by the storybook build command. When a built Storybook is published to the web, the bundle’s source is viewable, thus potentially exposing those variables to anyone with access. If those variables contained secrets, they should be considered compromised.

Who is impacted?

For a project to be vulnerable to this issue, it must:

  • Build the Storybook (i.e. run storybook build directly or indirectly) in a directory that contains a .env file (including variants like .env.local)
  • The .env file contains sensitive secrets
  • Use Storybook version 7.0.0 or above
  • Publish the built Storybook to the web

Storybooks built without a .env file at build time are not affected, including common CI-based builds where secrets are provided via platform environment variables rather than .env files.

Users' Storybook runtime environments (i.e. storybook dev) are not affected. Deployed applications that share a repo with a project's Storybook are not affected.

Storybook 6 and below are not affected.

Recommended actions

First, Storybook recommends that everyone audit for any sensitive secrets provided via .env files and rotate those keys.

Second, Storybook has released patched versions of all affected major Storybook versions that no longer have this vulnerability. Projects should upgrade their Storybook—on both local machines and CI environments—to one of these versions before publishing again.

  • 10.1.10+
  • 9.1.17+
  • 8.6.15+
  • 7.6.21+

Finally, some projects may have been relying on the undocumented behavior at the heart of this issue and will need to change how they reference environment variables after this update. If a project can no longer read necessary environmental variable values, it can either prefix the variables with STORYBOOK_ or use the env property in Storybook’s configuration to manually specify values. In either case, do not include sensitive secrets as they will be included in the built bundle.

Further information

Details of the vulnerability can be found on the Storybook announcement.

Severity

  • CVSS Score: 7.3 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Storybook Dev Server is Vulnerable to WebSocket Hijacking

CVE-2026-27148 / GHSA-mjf5-7g4m-gx5w

More information

Details

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.

Severity

  • CVSS Score: 8.9 / 10 (High)
  • Vector String: 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

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Storybook: Missing origin validation in Storybook preview allows code injection from malicious websites

CVE-2026-114125 / GHSA-f2ph-cmg5-wxc8

More information

Details

Summary: A malicious website may be able to cause unauthorized file changes in a developer’s project while an affected Storybook development server is running. Under additional conditions, a changed file could be executed by a local runtime with the developer’s privileges. We are not aware of exploitation in the wild.

Who is impacted?

You are impacted if you run a Storybook dev server in the affected versions.

You are not impacted if:

  • You run a dev server that you never open in a web browser (e.g. headless automation, MCP clients)
  • You run or visit a built version of Storybook

Recent versions of Chrome and Firefox may ask for permission before a website can connect to a localhost service. This reduces the risk, but does not remove it. Do not grant this permission to websites you don’t trust.

Recommended actions
Upgrade Storybook

Storybook has released patched versions of all affected major Storybook versions that fix all the vulnerabilities necessary for the worst-case scenario above to occur.

Upgrade to a patched version listed below before running storybook dev again. If you cannot upgrade immediately, do not run an affected Storybook dev server until you can apply the fix.

  • 11.0.0-alpha.6
  • 10.6.2
  • 9.1.21
  • 8.6.19
Review potentially breaking changes

Due to the exceptional nature of the reported vulnerabilities, the Storybook team has decided to change the default behavior of Storybook, including versions 8 and 9, for several network-related features that are not essential to most Storybook users' workflow. If your team relies on the affected features, we've added feature flags that can disable specific security updates to support your existing workflows.

Please carefully read the introduced flags and the consequences of using them.

Iframe embedding over the network is disabled by default

Storybook no longer allows the manager or preview to be embedded as an iframe on a website with a different host name. Built versions of Storybook are unaffected and can be freely embedded.

If you rely on embedding a Storybook dev server through a separate web app, run that separate app on localhost. You may also use the security.insecureRemoteIframeEmbed feature flag to re-enable iframe embedding from any origin.

The preview iframe rejects messages sent by an unknown host

Both the Storybook preview and manager now restrict the origin of iframes and parent windows that they can send messages to and receive messages from using the postMessage API.

By default, Storybook in dev mode only accepts communication with its own origin and other localhost services. Built Storybooks continue to accept communication from unknown origins.

A Storybook addon or integration could hypothetically rely on postMessage to update a live story's args. If you do that, reach out to the Storybook team to explore safer alternatives.

Storybook composition also relies on postMessage, so a composed Storybook on a different origin now fails to load unless it has been built. The security.insecureIframeMessaging feature flag disables this protection, but we recommend you build composed Storybooks instead.

The highlight event signature has changed

Storybook’s own accessibility addon uses the highlight event to inject highlights into the preview, which a user can click. Clicking the highlight opens a menu with a link to a documentation page.

The API for that event was too permissive and could be used to trigger arbitrary events, including events processed by the user’s dev server. We reworked the API to prevent abuse. Besides the accessibility addon, Chromatic's Visual Tests addon uses this API to link to documentation from highlighted ignored elements. Update the Visual Tests addon to version 5.5.1 or later to keep that link working. Because no other addons use this API as far as we know, we have not added a feature flag to restore the old API.

Disclosure timeline

On September 30th, the Storybook team received a responsible disclosure showing how a malicious website can embed a Storybook dev server's preview iframe and send events to the dev server on the developer's machine.

They combined this information with findings from an ongoing security audit to come up with a worst-case-scenario exploitation of the disclosed vulnerability, and the ones we independently discovered. They then worked to address all layers necessary for this worst-case scenario to happen. We have not received evidence of exploitation in real Storybook projects. The attack outlined in this advisory relies on correctly exploiting a sequence of many vulnerabilities, some of which were never disclosed to the Storybook team.

Worst-case attack scenario

An attacker-controlled website can interact with the preview of a running Storybook dev server. With user interaction, it may cause the dev server to make unauthorized changes to story files. If a malicious file is subsequently executed by a local runtime, the attack could lead to arbitrary code execution with the developer’s permissions.

Severity

  • CVSS Score: 9.4 / 10 (Critical)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Storybook dev server vulnerable to code injection from the local network

CVE-2026-114126 / GHSA-px85-f4q5-jh77

More information

Details

Summary: The Storybook dev server exposes its WebSocket authentication token to any client that can load its HTML pages. Any host on a LAN can open a Storybook app by IP address, and therefore obtain the token. The WebSocket can be used to inject code into story files or to create new files. Under the right circumstances, an attacker can execute code on the machine of a developer connected on the same LAN.

Who is impacted?

You are impacted if you run a Storybook dev server whilst connected on an untrusted local network, or to a WiFi access point posing as a trusted network. The impact of this advisory is more important if you have the Vitest addon installed and are using an old version of Vitest.

You are not impacted if:

  • You run a dev server in an environment that other devices on your network cannot reach (e.g. a container that does not publish the Storybook port, or publishes it only on 127.0.0.1)
  • You run a dev server whilst connected to a trusted local network
  • You serve a built version of Storybook on your machine
Recommended actions
Upgrade Storybook

Storybook has released patched versions of all affected major Storybook versions that fix all the vulnerabilities necessary for the worst-case scenario above to occur.

Upgrade to a patched version listed below before running storybook dev again. If you cannot upgrade immediately, do not run an affected Storybook dev server until you can apply the fix.

  • 11.0.0-alpha.6
  • 10.6.2
  • 9.1.21
  • 8.6.19
Review potentially breaking changes

Due to the exceptional nature of the reported vulnerabilities, the Storybook team has decided to change the default behavior of Storybook, including versions 8 and 9, for several network-related features that are not essential to most Storybook users' workflow. If your team relies on the affected features, this document explains how to fall back to the previous behavior.

Storybook now only listens on 127.0.0.1 by default

By default, the Storybook dev server no longer binds to all network interfaces on your machine. It only binds to the loopback address 127.0.0.1. You can still open it at http://localhost:6006. This prevents other devices on the same network from seeing your Storybook server.

To share a Storybook with others, consider publishing it to Chromatic (free). To share it on a LAN without exposing the dev server, build a static Storybook with storybook build and serve the output folder with any static file server.

To share a live Storybook running in dev mode, you can use the --host CLI option to bind to the LAN IP you want to share Storybook on, e.g. storybook dev --host 192.168.0.110. Host and origin validation stays enabled with this option. If you use --host 0.0.0.0 instead, also set core.allowedHosts to the hostnames you will use. Without it, host and origin validation is disabled, and Storybook shows a warning and asks you to confirm before it starts.

Consider using a firewall to restrict incoming packets to known colleague IPs, and avoid using --host on an untrusted WiFi network.

The Vitest addon now disables browser.api.allowWrite and browser.api.allowExec

Storybook no longer allows code running in Vitest Browser mode to write to the developer’s machine or execute other processes. In the unlikely scenario that you rely on this capability in your tests, you can manually re-enable these APIs in your Vitest config.

The saveStoryRequest event validates input more strictly

Storybook strengthened input validation in saveStoryRequest, so addons and the Storybook UI can now only write serialized args and story titles. It is no longer possible to exploit input validation weaknesses to e.g. write play functions with a custom addon.

If you develop an addon that writes or edits files on users’ behalf, reach out to the Storybook team to get advice on security best practice.

Disclosure timeline

On August 19th, the Storybook team received a responsible disclosure showing that the WebSocket token can be stolen by an attacker sharing a LAN with a Storybook dev server.

The disclosure identified several actions an attacker can do. An attacker can bypass input validation to write a payload in a story file.

They can then trigger a test run via the WebSocket. If the Vitest addon is installed, the payload can exploit a Vitest API to write other files, with more exploit logic to the user’s filesystem.

Depending on the exploit content, where the file is written, and what software the developer uses, that exploit could then be executed.

Severity

  • CVSS Score: 8.7 / 10 (High)
  • Vector String: CVSS:4.0/AV:A/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

storybookjs/storybook (storybook)

v9.1.21

Compare Source

9.1.21

  • Highlight: Prevent menu items from emitting arbitrary channel events
  • Channels: Restrict preview postMessage to known manager origins
  • Core: Separate manager and preview roles on the dev server channel
  • Core: Block iframe embedding of the dev server from non-localhost origins
  • Core: Reject component search queries outside the project
  • Core: Validate component export name when creating a story
  • Core: Add host validation warning and origin validation for MCP
  • Core: Contain save story path to the project root
  • Core: Validate save story name and arg keys as identifiers
  • Addon Vitest: Disable browser file writes and command execution

v9.1.20

Compare Source

9.1.20

  • Add request validation

v9.1.19

Compare Source

9.1.19

  • Harden websocket connection

v9.1.18

Compare Source

9.1.18

  • No-op release. No changes.

v9.1.17

Compare Source

9.1.17

v9.1.16

Compare Source

v9.1.15

Compare Source

v9.1.14

Compare Source

v9.1.13

Compare Source

v9.1.12

Compare Source

  • Maintenance: Hotfix for missing nextjs dts files, thanks @​ndelangen!

v9.1.11

Compare Source

v9.1.10

Compare Source

v9.1.9

Compare Source

  • Angular: Enable experimental zoneless detection on Angular v21 - #​32580, thanks @​yannbf!
  • Svelte: Ignore inherited HTMLAttributes docgen when using utility types - #​32173, thanks @​steciuk!

v9.1.8

Compare Source

v9.1.7

Compare Source

v9.1.6

Compare Source

v9.1.5

Compare Source

v9.1.4

Compare Source

v9.1.3

Compare Source


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@vercel

vercel Bot commented Jan 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ui-components Ready Ready Preview Oct 24, 2026 6:30pm UTC

Request Review

@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch from fefe155 to 27928f7 Compare February 12, 2026 12:34
@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch from 27928f7 to 8bebd13 Compare February 26, 2026 19:13
@renovate renovate Bot changed the title Update dependency storybook to v9.1.17 [SECURITY] Update dependency storybook to v9.1.19 [SECURITY] Feb 26, 2026
@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch from 8bebd13 to 59050de Compare February 28, 2026 22:11
@renovate renovate Bot changed the title Update dependency storybook to v9.1.19 [SECURITY] Update dependency storybook to v9.1.17 [SECURITY] Feb 28, 2026
@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch from 59050de to 68a812b Compare March 6, 2026 03:41
@renovate renovate Bot changed the title Update dependency storybook to v9.1.17 [SECURITY] Update dependency storybook to v9.1.19 [SECURITY] Mar 6, 2026
@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch from 68a812b to 54760e3 Compare March 11, 2026 23:08
@renovate renovate Bot changed the title Update dependency storybook to v9.1.19 [SECURITY] Update dependency storybook to v9.1.17 [SECURITY] Mar 11, 2026
@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch from 54760e3 to ce3f094 Compare March 14, 2026 10:06
@renovate renovate Bot changed the title Update dependency storybook to v9.1.17 [SECURITY] Update dependency storybook to v9.1.19 [SECURITY] Mar 14, 2026
@renovate renovate Bot changed the title Update dependency storybook to v9.1.19 [SECURITY] Update dependency storybook to v9.1.19 [SECURITY] - autoclosed Mar 27, 2026
@renovate renovate Bot closed this Mar 27, 2026
@renovate
renovate Bot deleted the renovate/npm-storybook-vulnerability branch March 27, 2026 02:53
@renovate renovate Bot changed the title Update dependency storybook to v9.1.19 [SECURITY] - autoclosed Update dependency storybook to v9.1.19 [SECURITY] Mar 30, 2026
@renovate renovate Bot reopened this Mar 30, 2026
@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch 2 times, most recently from ce3f094 to fac8f94 Compare March 30, 2026 19:03
@renovate renovate Bot changed the title Update dependency storybook to v9.1.19 [SECURITY] Update dependency storybook to v9.1.19 [SECURITY] - autoclosed Apr 27, 2026
@renovate renovate Bot closed this Apr 27, 2026
@renovate renovate Bot changed the title Update dependency storybook to v9.1.19 [SECURITY] - autoclosed Update dependency storybook to v9.1.19 [SECURITY] Apr 27, 2026
@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch from 17b9c62 to a437e3e Compare May 28, 2026 22:30
@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch from a437e3e to 3d8c9fe Compare June 11, 2026 22:06
@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch from 3d8c9fe to 74b8dde Compare July 12, 2026 14:53
@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch from 74b8dde to 5edf3d6 Compare July 24, 2026 23:03
@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch from 5edf3d6 to c7626f4 Compare August 12, 2026 02:57
@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch from c7626f4 to cb2a9dd Compare August 26, 2026 23:02
@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch from cb2a9dd to 587e85b Compare September 3, 2026 00:28
@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch from 587e85b to 6d80a3a Compare September 7, 2026 20:04
@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch from 6d80a3a to 1269731 Compare October 13, 2026 13:50
@renovate renovate Bot changed the title Update dependency storybook to v9.1.19 [SECURITY] Update dependency storybook to v9.1.19 [SECURITY] - autoclosed Oct 22, 2026
@renovate renovate Bot closed this Oct 22, 2026
@renovate renovate Bot changed the title Update dependency storybook to v9.1.19 [SECURITY] - autoclosed Update dependency storybook to v9.1.19 [SECURITY] Oct 23, 2026
@renovate renovate Bot reopened this Oct 23, 2026
@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch 2 times, most recently from 1269731 to bf054e0 Compare October 23, 2026 00:00
@renovate
renovate Bot force-pushed the renovate/npm-storybook-vulnerability branch from bf054e0 to 83c88f4 Compare October 24, 2026 18:29
@renovate renovate Bot changed the title Update dependency storybook to v9.1.19 [SECURITY] Update dependency storybook to v9.1.21 [SECURITY] Oct 24, 2026

This branch was successfully deployed

1 active deployment
Preview — 83c88f4e Deployed Oct 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants