CVE-2024-21636 json
view_component Cross-site Scripting vulnerability
published 2024-01-04 2 y ago modified 2026-09-10 1 mo ago also GHSA-wf2x-8w6j-qw37 , EUVD-2024-0446
- cvss
- 6.1
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.5%
- EPSS 0.5% chance of exploitation in 30 days, percentile 42%
- public exploits
- 0
- none known
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`.
Patch / fix
- rubygems view_component 2.83.0, 3.9.0
- viewcomponent view_component 2.83.0, 3.9.0
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 2 y ago
Exploit prediction
0.50% chance of exploitation in the next 30 days, higher than 42% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- github.com https://github.com/ViewComponent/view_component/pull/1950 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| GitHub | 3.1 | 6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| rubygems | view_component | >=3.0.0, <3.9.0 <2.83.0 |
3.9.0 2.83.0 |
Affected products
- ViewComponent view_component
Classification
- Weakness
-
- CWE-79 Improper Neutralization of Input During Web Page Generation
References
-
github.com
/ViewComponent/view_component/pull/1950
web, exploit, issue-tracking, patch
-
github.com
/ViewComponent/view_component/pull/1962
web, issue-tracking
-
github.com
/ViewComponent/view_component/commit/0d26944a8d2730ea40e60eae23d70684483e5017
web, patch
-
github.com
/ViewComponent/view_component/commit/c43d8bafa7117cbce479669a423ab266de150697
web, patch
-
github.com
/ViewComponent/view_component/security/advisories/GHSA-wf2x-8w6j-qw37
web, vendor-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2024-21636
advisory
-
github.com
/ViewComponent/view_component
package
-
github.com
/rubysec/ruby-advisory-db/blob/master/gems/view_component/CVE-2024-21636.yml
web
Sources
- CVE List CVE-2024-21636
- GitHub Advisory GHSA-wf2x-8w6j-qw37
- NVD CVE-2024-21636
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.