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 system test entrypoint canonicalizes a user-controlled file path with File.realpath, then checks whether the resolved path starts with the temp directory path. This is not a safe containment check because sibling directories can share the same string prefix. This vulnerability is fixed in 4.9.0.
Published: 2026-05-26
Score: 5.9 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

ViewComponent implements a system test entry point that sanitizes a user‑controlled file path with File.realpath and then verifies that the resolved path starts with the temporary directory prefix. This containment check is not safe because sibling directories can share the same string prefix, allowing an attacker to craft a path that resolves to a sibling of the intended temp directory. The result is an unintended disclosure or modification of files outside the test sandbox, classified as CWE‑187 – Improper Restriction of Operations within the Bounds of a Resource. The CVSS score of 5.9 indicates the vulnerability is of moderate severity.

Affected Systems

The flaw persists in ViewComponent versions 3.0.0 through 4.9.0. Systems that have not upgraded to the 4.9.0 release, which implements the correct containment logic, are vulnerable. No specific operating system or deployment environment is excluded; the issue solely depends on the ViewComponent library version in use.

Risk and Exploitability

The CVSS score of 5.9 reflects moderate risk, while no EPSS score is available and the flaw is not listed in the CISA KEV catalog, suggesting a lower likelihood of current exploitation. Based on the description, it is inferred that the attacker must control or influence the file path supplied to the system test entry point, typically by injecting custom test data or tampering with the test execution environment. Consequently, the exploitation window is limited to environments where the test harness is exposed to untrusted input or where an attacker can manipulate test configuration.

Generated by OpenCVE AI on May 26, 2026 at 22:29 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade ViewComponent to version 4.9.0 or later to apply the fixed path handling logic.
  • If an upgrade cannot be performed immediately, restrict the system test temporary directory so that it is not writable or readable by untrusted processes, thereby limiting the impact of any path manipulation.
  • Alternatively, replace the existing prefix check with a strict containment test that verifies the resolved path is a descendant of the designated temporary directory, ensuring proper isolation.

Generated by OpenCVE AI on May 26, 2026 at 22:29 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-hg3h-g7xc-f7vp view_component: System Test Entry Point Path Check Allows Sibling Directory Escape
History

Tue, 26 May 2026 21:45:00 +0000

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

Tue, 26 May 2026 20:30: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 3.0.0 to 4.9.0, the system test entrypoint canonicalizes a user-controlled file path with File.realpath, then checks whether the resolved path starts with the temp directory path. This is not a safe containment check because sibling directories can share the same string prefix. This vulnerability is fixed in 4.9.0.
Title view_component: System Test Entry Point Path Check Allows Sibling Directory Escape
Weaknesses CWE-187
References
Metrics cvssV3_1

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


Subscriptions

Viewcomponent View Component
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-05-26T19:40:47.661Z

Reserved: 2026-05-07T21:21:48.352Z

Link: CVE-2026-44837

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-05-26T21:16:38.853

Modified: 2026-05-26T21:16:38.853

Link: CVE-2026-44837

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-05-26T22:30:18Z

Weaknesses