view_component Cross-site Scripting vulnerability
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
view_component is a framework for building reusable, testable, and encapsulated view components in Ruby on Rails. Versions prior to 3.9.0 and 2.83.0 have a cross-site scripting vulnerability that has the potential to impact anyone rendering a component directly from a controller with the view_component gem. Note that only components that define a `#call` method (i.e. instead of using a sidecar template) are affected. The return value of the `#call` method is not sanitized and can include user-defined content. In addition, the return value of the `#output_postamble` methodis not sanitized, which can also lead to cross-site scripting issues. Versions 3.9.0 and 2.83.0 have been released and fully mitigate both the `#call` and the `#output_postamble` vulnerabilities. As a workaround, sanitize the return value of `#call`.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| ViewComponent | view_component | 3.0.0 to before 3.9.0; before 2.83.0 | 3.9.0, 2.83.0 | Patch available | CNA |
| — | view_component (RubyGems) | 3.0.0 to before 3.9.0 | 3.9.0 | Patch available | GHSA-wf2x-8w6j-qw37 |
| — | view_component (RubyGems) | before 2.83.0 | 2.83.0 | Patch available | GHSA-wf2x-8w6j-qw37 |
- view_component VendorViewComponent Affected 3.0.0 to before 3.9.0; before 2.83.0 Fixed in 3.9.0, 2.83.0 Patch available CNA
- view_component (RubyGems) Vendor— Affected 3.0.0 to before 3.9.0 Fixed in 3.9.0 Patch available GHSA-wf2x-8w6j-qw37
- view_component (RubyGems) Vendor— Affected before 2.83.0 Fixed in 2.83.0 Patch available GHSA-wf2x-8w6j-qw37
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:viewcomponent:view_component:*:*:*:*:*:ruby:*:* | before 2.83.0; 3.0.0 to before 3.9.0 | Vulnerable | ViewComponent |
- cpe:2.3:a:viewcomponent:view_component:*:*:*:*:*:ruby:*:* Versions before 2.83.0; 3.0.0 to before 3.9.0 Vulnerable ·ViewComponent
Remediation
- Fix · CNA view_component (ViewComponent) Fixed in 3.9.0, 2.83.0
- Fix · GHSA-wf2x-8w6j-qw37 view_component (RubyGems) Fixed in 3.9.0 Advisory →
- Fix · GHSA-wf2x-8w6j-qw37 view_component (RubyGems) Fixed in 2.83.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2024-21636
- 2026-10-03 Alias added: GHSA-wf2x-8w6j-qw37
References
Patch 2
Advisory 2
More ViewComponent View Component vulnerabilities
- TI-2026-39344 view_component: around_render HTML-Safety Bypass CVSS 3.1HIGH 8.7
- TI-2026-32717 view_component: System Test Entry Point Path Check Allows Sibling Directory Escape CVSS 3.1HIGH 7.5
- TI-2026-39343 view_component: Reused Component Instances Retain Stale Render Context CVSS 3.1MEDIUM 6.8
Sources
- CVE-2024-21636 · CVE Program
- CVE-2024-21636 · NVD
- FIRST EPSS
- GHSA-wf2x-8w6j-qw37 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences