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 instances retain render-scoped objects across calls to render_in; if the same component, collection, or spacer component instance is reused across requests, users, tenants, or threads, later renders can use stale helpers, controller, request, view_flow, format/variant details, and slot child context from an earlier render. This can cause authorization-aware components to render privileged UI for a lower-privileged user, generate links using a stale Host header, leak slot/helper state, and mix request context under concurrent rendering. This issue is fixed in version 4.12.0.
Published: 2026-07-17
Score: 6.8 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

ViewComponent instances retain render‑scoped objects across multiple calls to render_in, allowing stale helpers, request, and controller data to persist. This flaw can cause components that are authorization‑aware to render privileged UI for lower‑privileged users, generate links with stale Host headers, leak slot or helper state, and mix request context during concurrent rendering. The vulnerability is a classic case of stale state and concurrency‑related flaws, as indicated by the associated CWE identifiers.

Affected Systems

The vulnerability affects the ViewComponent framework for Ruby on Rails, specifically any installation that uses versions 4.0.0 through 4.12.0 inclusive. These versions allow component instances to be reused across requests, tenants, or threads in a way that is not safe for isolated rendering contexts.

Risk and Exploitability

With a CVSS score of 6.8, the vulnerability falls into the medium severity range. The EPSS score of less than 1% indicates a very low probability of exploitation in the wild, and the vulnerability is not listed in the CISA KEV catalog. Nonetheless, the likely attack vector involves an attacker or malicious user that can influence the reuse of component instances, such as through misconfigured caching or shared instance patterns, to coerce the application into rendering stale or privileged content.

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

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade to ViewComponent version 4.12.0 or newer, which removes the stale state retention bug.
  • Audit the codebase to ensure that component instances are not stored in shared variables or reused across different requests, tenants, or threads; create a new instance for each request or rendering context.
  • If an immediate upgrade is not possible, disable or avoid any global caching of component instances until the patch has been applied, to prevent stale data from influencing subsequent renders.

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-9h85-g7w3-rh49 ViewComponent: Reused Component Instances Retain Stale Render Context
History

Mon, 20 Jul 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Fri, 17 Jul 2026 23:00:00 +0000

Type Values Removed Values Added
First Time appeared Viewcomponent
Viewcomponent view Component
Vendors & Products Viewcomponent
Viewcomponent view Component

Fri, 17 Jul 2026 21:00:00 +0000

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 instances retain render-scoped objects across calls to render_in; if the same component, collection, or spacer component instance is reused across requests, users, tenants, or threads, later renders can use stale helpers, controller, request, view_flow, format/variant details, and slot child context from an earlier render. This can cause authorization-aware components to render privileged UI for a lower-privileged user, generate links using a stale Host header, leak slot/helper state, and mix request context under concurrent rendering. This issue is fixed in version 4.12.0.
Title view_component: Reused Component Instances Retain Stale Render Context
Weaknesses CWE-362
CWE-488
CWE-668
References
Metrics cvssV3_1

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


Subscriptions

Viewcomponent View Component
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-20T13:46:20.930Z

Reserved: 2026-06-15T18:01:15.511Z

Link: CVE-2026-54497

cve-icon Vulnrichment

Updated: 2026-07-20T13:46:05.788Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-30T23:30:08Z

Weaknesses
  • CWE-362

    Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')

  • CWE-488

    Exposure of Data Element to Wrong Session

  • CWE-668

    Exposure of Resource to Wrong Sphere