CVE-2026-54498

view_component: around_render HTML-Safety Bypass

Published Jul 17, 2026 CVSS 3.1 · 8.7 High EPSS < 1% KEV · Not listed
Description
view_component is a framework for building reusable, testable, and encapsulated view components in Ruby on Rails. From 4.0.0 until 4.12.0, ViewComponent::Base#around_render can return HTML-unsafe strings that bypass the escaping behavior applied to normal #call return values. This creates an XSS risk when downstream applications use around_render to wrap, replace, instrument, or conditionally return content that includes user-controlled data, and ViewComponent::Collection#render_in can amplify the issue by joining per-item results and marking the entire output html_safe, converting raw unsafe output into an ActiveSupport::SafeBuffer. This issue is fixed in version 4.12.0.

Analysis

AI-generated

Technical impact

ViewComponent::Base#around_render, used in Ruby on Rails view components, can return strings that bypass the framework's normal escaping mechanism. From version 4.0.0 through 4.12.0, an attacker can supply user‑controlled data to around_render, causing the component to output raw, unsanitized HTML or JavaScript. This vulnerability is an instance of client‑side script injection (CWE‑79) and leads to cross‑site scripting (XSS) where malicious code can be executed in the context of trusted users' browsers, potentially exposing session data, credentials, or enabling further attacks.

Affected Systems

The flaw affects the ViewComponent framework, specifically the view_component gem on Ruby on Rails. Vulnerable releases include versions from 4.0.0 until 4.12.0; the issue is resolved in v4.12.0. The gem's changelog indicates that around_render is now correctly marked safe only when explicitly required. Applications built with earlier gem versions, especially those that use around_render to wrap or replace content that incorporates user data or that employ ViewComponent::Collection#render_in for batch rendering, are at risk. Upgrading to the fixed version or applying the published patch is the recommended approach.

Risk and Exploitability

The CVSS score of 8.7 classifies the problem as high severity, yet the EPSS score is reported as < 1%, suggesting a low probability of current exploitation. The vulnerability is not listed in CISA's KEV catalog, and no active exploit code targeting this flaw has been documented. Nevertheless, the attack requires only that a user interacts with an affected Rails application, making it remotely exploitable via standard web requests. Security teams should treat this as a significant risk for any application that employs the vulnerable component patterns, particularly when handling sensitive user input.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the view_component gem to version 4.12.0 or later to apply the vendor fix.
  • Audit any use of :around_render in your view components, ensuring you do not wrap untrusted user content without proper sanitization or escaping.
  • When rendering collections with ViewComponent::Collection#render_in, verify that the combined output is explicitly escaped and not automatically marked as html_safe.

Generated by OpenCVE AI on July 30, 2026 at 23:25 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-97jw-64cj-jc58 ViewComponent: around_render HTML-Safety Bypass
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Viewcomponent
Viewcomponent view Component
Vendors & Products Viewcomponent
Viewcomponent view Component
Type Values Removed Values Added
Description view_component is a framework for building reusable, testable, and encapsulated view components in Ruby on Rails. From 4.0.0 until 4.12.0, ViewComponent::Base#around_render can return HTML-unsafe strings that bypass the escaping behavior applied to normal #call return values. This creates an XSS risk when downstream applications use around_render to wrap, replace, instrument, or conditionally return content that includes user-controlled data, and ViewComponent::Collection#render_in can amplify the issue by joining per-item results and marking the entire output html_safe, converting raw unsafe output into an ActiveSupport::SafeBuffer. This issue is fixed in version 4.12.0.
Title view_component: around_render HTML-Safety Bypass
Weaknesses CWE-79
References
Metrics cvssV3_1

{'score': 8.7, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 20, 2026, 5:38 PM
Reserved
Jun 15, 2026, 6:01 PM
Status
Analyzed
Published
Jul 17, 2026, 9:17 PM
Modified
Oct 24, 2026, 8:10 PM