Description
Storybook is a frontend workshop for building user interface components and pages in isolation. Prior to versions 7.6.23, 8.6.17, 9.1.19, and 10.2.10, 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. 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 the 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. Both are vulnerable to injection via unsanitized input in the componentFilePath field, which can be exploited to achieve persistent XSS or Remote Code Execution (RCE). Versions 7.6.23, 8.6.17, 9.1.19, and 10.2.10 contain a fix for the issue.
Problem types
CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Product status
>= 8.1.0, < 8.6.17
>= 9.0.0, < 9.1.19
>= 10.0.0, < 10.2.10
References
github.com/...rybook/security/advisories/GHSA-mjf5-7g4m-gx5w
github.com/...ommit/0affdf928bd6fafbadfb1dfe22ce6104805e10e8
github.com/...ommit/54689a8add18ea75d628c540f4bc677592a1e685
github.com/...ommit/b8cfa77c73940c140acdcd8a06ab1ea913c44761
github.com/...ommit/d34085f39c647f5c23c3a3b2d197c18602fcf876
github.com/storybookjs/storybook/releases/tag/v10.2.10
github.com/storybookjs/storybook/releases/tag/v7.6.23
github.com/storybookjs/storybook/releases/tag/v8.6.17
github.com/storybookjs/storybook/releases/tag/v9.1.19