{"cve":"CVE-2024-21636","nvd":{"published":"2024-01-04T20:15:25.300","modified":"2026-06-17T07:09:53.780","status":"Modified","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`.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1},"cwes":["CWE-79"],"references":["https://github.com/ViewComponent/view_component/commit/0d26944a8d2730ea40e60eae23d70684483e5017","https://github.com/ViewComponent/view_component/commit/c43d8bafa7117cbce479669a423ab266de150697","https://github.com/ViewComponent/view_component/pull/1950","https://github.com/ViewComponent/view_component/pull/1962","https://github.com/ViewComponent/view_component/security/advisories/GHSA-wf2x-8w6j-qw37"],"products":["viewcomponent:view_component"],"source":"nvd","synced_at":"2026-10-19T21:43:38.875533635+00:00"},"epss":{"cve":"CVE-2024-21636","score":0.00495,"percentile":0.42523,"date":"2026-10-31"},"kev":null,"osv":[{"id":"GHSA-wf2x-8w6j-qw37","url":"https://osv.dev/vulnerability/GHSA-wf2x-8w6j-qw37","summary":"view_component Cross-site Scripting vulnerability","modified":"2026-09-10T03:49:24.818621008Z","packages":[{"ecosystem":"RubyGems","name":"view_component","purl":"pkg:gem/view_component","ranges":[">=3.0.0 <3.9.0"],"fixed":["3.9.0"]},{"ecosystem":"RubyGems","name":"view_component","purl":"pkg:gem/view_component","ranges":["<2.83.0"],"fixed":["2.83.0"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}