CVE-2026-54497: ViewComponent Component Instances Retain Stale Render Context

view_component Updated 16 Jul 2026

Summary

15/07/2026
Yes i
Moderate
6.8

CVE-2026-54497: ViewComponent: Reused Component Instances Retain Stale Render Context. Affects view_component versions >= 4.0.0, < 4.12.0. Fixed in 4.12.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

ViewComponent is a Ruby library designed to facilitate the creation of reusable view components in Rails applications. It allows developers to encapsulate view logic and presentation in a modular way, enhancing code maintainability and reusability. However, the library has a vulnerability that arises from the reuse of component instances across different render contexts, leading to potential security issues.

Vulnerability Detail

The vulnerability in ViewComponent arises from the fact that instances of ViewComponent::Base can retain stale render context information when reused across different requests or user sessions. This can lead to unauthorized access to privileged UI elements, as components may render with outdated context, including helpers, controllers, and request data. The root cause is the mutable nature of component instances, which do not reset their state between renders, allowing for cross-user context mixing and potential privilege escalation.

How To Fix

Latest published version: 4.19.0 as of 23 Oct 2026

gem install view_component -v 4.19.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.12.0

This is the first release that contains the fix.

gem install view_component -v 4.12.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid reusing component instances across different render contexts. Instead, create new instances of components for each render call. For example, instead of reusing an existing component instance, instantiate a new one like this: MyComponent.new(...) for each render.

Conclusion

The vulnerability CVE-2026-54497 in the ViewComponent library poses a significant risk due to the reuse of component instances across different render contexts, leading to potential unauthorized access and privilege escalation. It is crucial to update to the patched version or implement the recommended workarounds to secure your application.

See every vulnerability recorded for view_component →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 6.8, indicating a moderate level of severity.

You can use Vulert, which monitors open-source vulnerabilities in your software. By uploading your manifest file like package-lock.json, you can receive real-time alerts. You can also check your application using the Vulert playground without any signup.

The potential impacts include unauthorized access to privileged UI elements, leaking sensitive information, and cross-user context mixing, which can lead to privilege escalation.

Yes, you can mitigate the risk by ensuring that component instances are not reused across different render contexts and by creating new instances for each render.

If you cannot update the package immediately, implement the workaround of creating new component instances for each render to minimize the risk of stale context being used.

Related vulnerabilities

Recent vulnerabilities recorded for view_component.

How To Fix

Latest published version: 4.19.0 as of 23 Oct 2026

gem install view_component -v 4.19.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.12.0

This is the first release that contains the fix.

gem install view_component -v 4.12.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback