GHSA-55hg-8qxv-qj4p
PhoenixStorybook: Unauthenticated remote code execution via HEEx template injection in phoenix_storybook playground
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
Blast Radius
phoenix_storybookReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Hex packages — download data is not available via public APIs for these ecosystems.
Description
Summary
An unsafe HEEx template generation vulnerability allows any unauthenticated user to execute arbitrary code on the server. The phoenix_storybook playground accepts user-controlled attribute values over WebSocket and interpolates them unsanitized into a HEEx template that is subsequently compiled and evaluated with full Elixir Kernel access.
Details
The vulnerability is a three-step chain:
1. Unsanitized WebSocket input (extra_assigns_helpers.ex)
The psb-assign event handler in PhoenixStorybook.Story.PlaygroundPreviewLive accepts arbitrary attribute names and values from unauthenticated WebSocket clients and stores them verbatim via ExtraAssignsHelpers.handle_set_variation_assign/3.
2. Unescaped interpolation into HEEx (component_renderer.ex)
ComponentRenderer.attributes_markup/1 builds a HEEx template string by interpolating binary attribute values directly:
{name, val} when is_binary(val) ->
~s|#{name}="#{val}"|
No escaping of " or { is performed. A value such as foo" injected={EXPR} bar=" breaks out of the attribute string and injects EXPR as an inline HEEx expression.
3. Unsandboxed evaluation (component_renderer.ex)
The resulting HEEx string is compiled via EEx.compile_string/2 and evaluated via Code.eval_quoted_with_env/3 with full Kernel imports and no sandbox. The injected expression executes on the server even if it causes a rendering error.
PoC
- Identify any story URL with a Playground tab (e.g.
/storybook/core_components/button). - Connect to the Phoenix LiveView WebSocket without any authentication.
- Join the story's LiveView channel and send a
psb-assignevent with an attribute value that escapes the HEEx attribute context and embeds an Elixir expression (e.g. aSystem.cmd/2call). - The server evaluates the injected expression and returns its output in the rendered response.
No authentication, no special configuration, and no user interaction are required.
Impact
This is a pre-authentication remote code execution vulnerability. Any user able to reach the storybook endpoint, including unauthenticated internet users if the storybook is publicly deployed, can execute arbitrary operating system commands with the privileges of the server process. All versions of phoenix_storybook from 0.5.0 before 1.1.0 are affected.
Resources
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 💧Hex | phoenix_storybook | ≥ 0.5.0&&< 1.1.0 | 1.1.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for phoenix_storybook. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update phoenix_storybook to 1.1.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-55hg-8qxv-qj4p is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-55hg-8qxv-qj4p is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-55hg-8qxv-qj4p. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-55hg-8qxv-qj4p in your dependencies?
O3 detects GHSA-55hg-8qxv-qj4p across Hex dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.