-
Support Rails
render_inoptions signature. Rails #50623 changed therender_insignature fromrender_in(view_context, &block)torender_in(view_context, **options, &block).ViewComponent::Base#render_in,ViewComponent::Collection#render_in, andViewComponent::Instrumentation#render_innow accept**options, restoring compatibility with Rails main and silencing the deprecation warning.Joel Hawksley
-
Fix stale render context on reused component instances. A
ViewComponent::Baseinstance memoized its controller, helpers, request, view context, lookup context, view flow, and requested format/variant on first render via||=. Rendering the same instance a second time (intentionally or via aliasing) reused that stale context, which could leak data across requests, sessions, or users.#render_innow resets these ivars on every call so each render derives its context from the current view.Joel Hawksley
-
Fix path traversal vulnerability in
ViewComponentsSystemTestControllerwhere sibling directories sharing a string prefix with the allowed temp directory could bypass the path containment check. Thestart_with?check has been replaced with a separator-aware prefix check, and nefarious path errors now return a 404 instead of an unhandled exception.Joel Hawksley
-
Fix preview route vulnerability where inherited methods on
ViewComponent::Preview(such asrender_with_template) could be invoked via the preview URL, allowing arbitrary internal Rails templates to be rendered with attacker-controlled locals and request parameters.render_argsnow raisesAbstractController::ActionNotFoundfor any example not explicitly declared on the preview subclass.Joel Hawksley