GHSA-55HG-8QXV-QJ4P

Vulnerability from github – Published: 2026-06-09 21:58 – Updated: 2026-06-09 21:58
VLAI
Summary
PhoenixStorybook: Unauthenticated remote code execution via HEEx template injection in phoenix_storybook playground
Details

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

  1. Identify any story URL with a Playground tab (e.g. /storybook/core_components/button).
  2. Connect to the Phoenix LiveView WebSocket without any authentication.
  3. Join the story's LiveView channel and send a psb-assign event with an attribute value that escapes the HEEx attribute context and embeds an Elixir expression (e.g. a System.cmd/2 call).
  4. 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

  • Introduction Commit: https://github.com/phenixdigital/phoenix_storybook/commit/e35379dfe2ef1a71b141899e36f431017c55265d
  • Patch Commit: https://github.com/phenixdigital/phoenix_storybook/commit/56ab8464d4375fa52db806148a06cce126ad481d
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Hex",
        "name": "phoenix_storybook"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.5.0"
            },
            {
              "fixed": "1.1.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-8467"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-06-09T21:58:57Z",
    "nvd_published_at": "2026-05-20T14:17:04Z",
    "severity": "CRITICAL"
  },
  "details": "### Summary\nAn 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.\n\n### Details\nThe vulnerability is a three-step chain:\n\n**1. Unsanitized WebSocket input (`extra_assigns_helpers.ex`)**\nThe `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`.\n\n**2. Unescaped interpolation into HEEx (`component_renderer.ex`)**\n`ComponentRenderer.attributes_markup/1` builds a HEEx template string by interpolating binary attribute values directly:\n```elixir\n{name, val} when is_binary(val) -\u003e\n  ~s|#{name}=\"#{val}\"|\n```\nNo 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.\n\n**3. Unsandboxed evaluation (`component_renderer.ex`)**\nThe 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.\n\n### PoC\n1. Identify any story URL with a Playground tab (e.g. `/storybook/core_components/button`).\n2. Connect to the Phoenix LiveView WebSocket without any authentication.\n3. Join the story\u0027s LiveView channel and send a `psb-assign` event with an attribute value that escapes the HEEx attribute context and embeds an Elixir expression (e.g. a `System.cmd/2` call).\n4. The server evaluates the injected expression and returns its output in the rendered response.\n\nNo authentication, no special configuration, and no user interaction are required.\n\n### Impact\nThis 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.\n\n## Resources\n\n* Introduction Commit: https://github.com/phenixdigital/phoenix_storybook/commit/e35379dfe2ef1a71b141899e36f431017c55265d\n* Patch Commit: https://github.com/phenixdigital/phoenix_storybook/commit/56ab8464d4375fa52db806148a06cce126ad481d",
  "id": "GHSA-55hg-8qxv-qj4p",
  "modified": "2026-06-09T21:58:57Z",
  "published": "2026-06-09T21:58:57Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/phenixdigital/phoenix_storybook/security/advisories/GHSA-55hg-8qxv-qj4p"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-8467"
    },
    {
      "type": "WEB",
      "url": "https://github.com/phenixdigital/phoenix_storybook/commit/56ab8464d4375fa52db806148a06cce126ad481d"
    },
    {
      "type": "WEB",
      "url": "https://cna.erlef.org/cves/CVE-2026-8467.html"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/phenixdigital/phoenix_storybook"
    },
    {
      "type": "WEB",
      "url": "https://osv.dev/vulnerability/EEF-CVE-2026-8467"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H",
      "type": "CVSS_V4"
    }
  ],
  "summary": "PhoenixStorybook: Unauthenticated remote code execution via HEEx template injection in phoenix_storybook playground"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…