RubySec

Providing security resources for the Ruby community

CVE-2026-44836 (view_component): view_component - Preview Route Can Dispatch Inherited Helper Methods'

view_component - Preview Route Can Dispatch Inherited Helper Methods'

Published: May 08, 2026

SECURITY IDENTIFIERS

GEM

view_component

SEVERITY

CVSS v3.x: 6.5 (Medium)

UNAFFECTED VERSIONS

< 3.0.0

PATCHED VERSIONS

>= 4.9.0

DESCRIPTION

The preview route derives an example name from the URL and calls it with public_send. The code does not verify that the requested method is one of the preview examples explicitly defined by the preview class.

As a result, inherited public methods on ViewComponent::Preview are route-reachable. The most important one is render_with_template, which accepts template: and locals:. Those values can come from request params and are later passed to Rails as render template:.

If previews are exposed, an attacker can render internal Rails templates that are not otherwise routable.

Severity: High if preview routes are externally reachable; Medium otherwise.

RELATED