Unauthenticated remote code execution via HEEx template injection in phoenix_storybook playground
Code Injection vulnerability in phenixdigital phoenix_storybook allows unauthenticated remote code execution via HEEx template injection in the component playground. A client can send attribute values over the playground WebSocket. A value that closes the attribute quote and adds a HEEx expression is evaluated as Elixir code on the server. PhoenixStorybook.Story.PlaygroundPreviewLive.handle_event/3 accepts attribute names and values from the client and stores them through PhoenixStorybook.ExtraAssignsHelpers.handle_set_variation_assign/3. PhoenixStorybook.Rendering.ComponentRenderer.attributes_markup/1 interpolates string values into a HEEx template without escaping. The template is compiled with EEx.compile_string/2 and evaluated. Releases published as phx_live_storybook have the same code in the PhxLiveStorybook namespace, where the first client entry point is PhxLiveStorybook.Entry.Playground.handle_event/3. This issue affects phoenix_storybook: from 0.5.0 before 1.1.0; phx_live_storybook: from 0.3.0 onward.