CVE-2026-54498 view_component: around_render HTML-Safety Bypass

High 8.7 Published Updated

Attackers can inject malicious scripts via around_render in ViewComponent, leading to XSS in Ruby on Rails applications.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-54498?

CVE-2026-54498 is a high-severity cross-site scripting vulnerability in ViewComponent view_component, published on 17 Jul 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official 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.

Weakness: CWE-79

Which versions are affected by CVE-2026-54498?

2 open source packages ship an affected version, including view_component. It affects 1 product.

PackageAffectedFixed in
view_component RubyGemsFrom 4.0.04.12.0
view_component RubyGemsFrom 4.0.04.12.0

Products include Viewcomponent View Component.

How do I fix CVE-2026-54498?

Upgrade view_component to 4.12.0 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2026-54498 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-54498 exists.

Sources

Also known as GHSA-97jw-64cj-jc58.

Is CVE-2026-54498 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free