CVE-2026-44837: CWE-187: Partial String Comparison in ViewComponent view_component
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.
AI Analysis
Technical Summary
The view_component framework for Ruby on Rails versions >= 3.0.0 and < 4.9.0 contains a partial string comparison vulnerability (CWE-187) in its system test entrypoint. It canonicalizes a user-supplied file path using File.realpath and then checks if the resolved path starts with the temporary directory path to enforce containment. However, this check is insufficient because sibling directories may share the same prefix string, leading to an unsafe containment verification. This flaw can be exploited to bypass intended directory restrictions. The vulnerability is addressed in version 4.9.0 of view_component.
Potential Impact
The vulnerability allows an attacker to potentially bypass directory containment checks by exploiting the partial string comparison logic. This could lead to unauthorized access to files outside the intended temporary directory scope. The CVSS score of 5.9 (medium severity) reflects a network attack vector with high confidentiality impact but requires high attack complexity and no privileges or user interaction. There are no known exploits in the wild at this time.
Mitigation Recommendations
This vulnerability is fixed in view_component version 4.9.0. Users of affected versions (>= 3.0.0 and < 4.9.0) should upgrade to version 4.9.0 or later to remediate this issue. Patch status is not explicitly stated beyond the fix in 4.9.0, so upgrading to this version is the recommended remediation.
CVE-2026-44837: CWE-187: Partial String Comparison in ViewComponent view_component
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.
CVSS v3.1
Score 5.9medium
Affected software
pkg:gem/view_component/view_componentRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The view_component framework for Ruby on Rails versions >= 3.0.0 and < 4.9.0 contains a partial string comparison vulnerability (CWE-187) in its system test entrypoint. It canonicalizes a user-supplied file path using File.realpath and then checks if the resolved path starts with the temporary directory path to enforce containment. However, this check is insufficient because sibling directories may share the same prefix string, leading to an unsafe containment verification. This flaw can be exploited to bypass intended directory restrictions. The vulnerability is addressed in version 4.9.0 of view_component.
Potential Impact
The vulnerability allows an attacker to potentially bypass directory containment checks by exploiting the partial string comparison logic. This could lead to unauthorized access to files outside the intended temporary directory scope. The CVSS score of 5.9 (medium severity) reflects a network attack vector with high confidentiality impact but requires high attack complexity and no privileges or user interaction. There are no known exploits in the wild at this time.
Mitigation Recommendations
This vulnerability is fixed in view_component version 4.9.0. Users of affected versions (>= 3.0.0 and < 4.9.0) should upgrade to version 4.9.0 or later to remediate this issue. Patch status is not explicitly stated beyond the fix in 4.9.0, so upgrading to this version is the recommended remediation.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-07T21:21:48.352Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a16041de29bf47b505ea066
Added to database: 05/26/2026, 20:35:41 UTC
Last enriched: 06/02/2026, 21:01:35 UTC
Last updated: 07/31/2026, 19:22:59 UTC
Views: 65
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.