Storybook unauthorized preview interaction via iframe messages
storybookjs storybook
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| storybook npm |
|
|
storybookjs storybook
| Product | Affected | Fixed in |
|---|---|---|
| storybook npm |
|
|
| @storybook/core npm |
|
|
| @storybook/core-server npm |
|
|
| @storybook/experimental-addon-test npm |
|
|
| @storybook/addon-vitest npm |
|
|
| @storybook/addon-mcp npm |
|
|
Storybook is a frontend workshop for building user interface components and pages in isolation. From 8.0.0 until 8.6.19, 9.1.21, 10.6.2, and 11.0.0-alpha.6, a malicious website can interact with the preview of a running Storybook development server. Insufficient iframe embedding and message-origin restrictions can allow attacker-controlled events to reach the running preview. A developer must visit the malicious website and interact with the injected interface. The attack can cause unauthorized changes to story files and, if a changed file is later executed by a local runtime, arbitrary code execution with the developer's privileges. This issue is fixed in 8.6.19, 9.1.21, 10.6.2, and 11.0.0-alpha.6.
From the CVE record · GitHub_M
A malicious website can send attacker-controlled events to the preview of a running Storybook development server because iframe embedding and message-origin restrictions are insufficient. A developer must visit the malicious site and interact with its injected interface. The attack can change story files without authorization and, if a changed file is later executed locally, run code with the developer's privileges.
Developers running Storybook or the listed Storybook npm packages should check for affected 8.x, 9.x, 10.x, and 11.0.0-alpha versions; affected ranges vary by package.