Skip to content
OpenAdvisories
Medium · 6.5 CVE-2026-44836 EUVD-2026-31972GHSA-7f3r-gwc9-2995

view_component: Preview Route Can Dispatch Inherited Helper Methods

Published May 26, 2026 · Updated May 27, 2026 · Assigned by GitHub_M

Description

view_component is a framework for building reusable, testable, and encapsulated view components in Ruby on Rails. From 3.0.0 to 4.9.0, 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. This vulnerability is fixed in 4.9.0.

Affected products

VendorProductAffectedFixed
ViewComponent view_component >= 3.0.0, < 4.9.0 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 ruby-view-component 4.12.0-1 —
Debian 12 ruby-view-component No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu 26.10 ruby-view-component No fix yet —
Ubuntu 24.04 LTS ruby-view-component No fix yet —

Affected packages

EcosystemPackageAffectedFixedRecord
RubyGems view_component >= 3.0.0, < 4.9.0 4.9.0 GHSA-7f3r-gwc9-2995

References