view_component - Preview Route Can Dispatch Inherited Helper Methods'
Published: May 08, 2026
SECURITY IDENTIFIERS
- CVE: CVE-2026-44836 (NVD)
- GHSA: GHSA-7f3r-gwc9-2995
- Vendor Advisory: https://github.com/ViewComponent/view_component/security/advisories/GHSA-7f3r-gwc9-2995
GEM
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.
