CVE-2026-44836
Deferred Deferred - Pending Action
Path Traversal in ViewComponent Preview Routes

Publication date: 2026-05-26

Last updated on: 2026-06-01

Assigner: GitHub, Inc.

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.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-05-26
Last Modified
2026-06-01
Generated
2026-06-16
AI Q&A
2026-05-27
EPSS Evaluated
2026-06-14
NVD
Affected Vendors & Products
Showing 2 associated CPEs
Vendor Product Version / Range
viewcomponent view_component to 4.9.0 (inc)
viewcomponent view_component From 3.0.0 (inc) to 4.9.0 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-749 The product provides an Applications Programming Interface (API) or similar interface for interaction with external actors, but the interface includes a dangerous method or function that is not properly restricted.
Attack-Flow Graph
AI Quick Actions
Instant insights powered by AI
Compliance Impact

The vulnerability in ViewComponent allows attackers to render internal Rails templates that are not normally routable, potentially exposing sensitive data such as secrets, configuration details, debug information, or admin-only partials.

Exposure of such sensitive information could lead to non-compliance with common standards and regulations like GDPR and HIPAA, which require protection of personal data and sensitive information.

If preview routes are externally accessible, this vulnerability increases the risk of unauthorized data exposure, thereby impacting compliance with these regulations.

Detection Guidance

This vulnerability can be detected by checking if the preview routes of the ViewComponent gem are externally accessible and if they allow calling inherited public methods such as render_with_template.

One way to detect exploitation attempts or the presence of this vulnerability is to send HTTP requests to the preview route with various method names, including those not explicitly defined as preview examples, and observe if the server responds by rendering internal templates.

Example commands using curl to test for this vulnerability could include:

  • curl -i http://your-app/rails/view_components/preview/render_with_template?template=some_internal_template
  • curl -i http://your-app/rails/view_components/preview/any_inherited_public_method

If these requests return rendered internal templates or do not return a 404 or 403 error, it indicates the vulnerability may be present.

Executive Summary

The vulnerability exists in the view_component framework for Ruby on Rails versions 3.0.0 to 4.9.0. It occurs because the preview route derives an example name from the URL and calls it using public_send without verifying that the requested method is explicitly defined as a preview example. This allows inherited public methods on ViewComponent::Preview, such as render_with_template, to be accessible via routes.

The render_with_template method accepts parameters like template: and locals:, which can come from request parameters and are passed to Rails as render template:. This means that if previews are exposed, an attacker can render internal Rails templates that are not normally accessible through routes.

This vulnerability was fixed in version 4.9.0 of the view_component framework.

Impact Analysis

This vulnerability can allow an attacker to render internal Rails templates that are not intended to be publicly accessible. By exploiting this, an attacker might gain access to sensitive information or internal views that could reveal application logic or data.

Since the vulnerability allows rendering of internal templates via crafted requests, it can lead to information disclosure, which is reflected in the CVSS score indicating high confidentiality impact.

Mitigation Strategies

The vulnerability is fixed in version 4.9.0 of the view_component framework. Immediate mitigation involves upgrading the view_component gem to version 4.9.0 or later.

If upgrading is not immediately possible, ensure that preview routes are not exposed to untrusted users, as the vulnerability allows attackers to render internal Rails templates via crafted requests.

Chat Assistant
Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-44836. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70
EPSS Chart