# CVE-2024-21636: view_component Cross-site Scripting vulnerability

- Severity: Medium 6.1 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.50%, higher than 44% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2024-01-04T20:09:08.564Z
- Modified: 2026-09-10T03:49:24.818Z
- Also known as: GHSA-wf2x-8w6j-qw37
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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`.

(As written by CVE List.)

## Affected

- ViewComponent view_component: >= 3.0.0, < 3.9.0; < 2.83.0; before 2.83.0; from 3.0.0 before 3.9.0
- view_component (RubyGems): from 3.0.0 before 3.9.0; before 2.83.0

## Every score

- GitHub_M: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://github.com/ViewComponent/view_component/pull/1950> (exploit, issue-tracking, patch, web)
- <https://github.com/ViewComponent/view_component/security/advisories/GHSA-wf2x-8w6j-qw37> (vendor-advisory, web)
- <https://github.com/ViewComponent/view_component/pull/1962> (issue-tracking, web)
- <https://github.com/ViewComponent/view_component/commit/0d26944a8d2730ea40e60eae23d70684483e5017> (patch, web)
- <https://github.com/ViewComponent/view_component/commit/c43d8bafa7117cbce479669a423ab266de150697> (patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-21636> (advisory)
- <https://github.com/ViewComponent/view_component> (package)
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/view_component/CVE-2024-21636.yml> (web)

## Sources

- CVE List: [CVE-2024-21636](https://www.cve.org/CVERecord?id=CVE-2024-21636), CVE Terms of Use, modified 2025-06-17
- GitHub Advisory Database: [GHSA-wf2x-8w6j-qw37](https://github.com/advisories/GHSA-wf2x-8w6j-qw37), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2024-21636](https://nvd.nist.gov/vuln/detail/CVE-2024-21636), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-21636 · Whole record: https://cve.day/CVE-2024-21636.json · Rebuilt by cve.day 2026-11-25T22:58:35.920Z
