{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2024-21636","id":"CVE-2024-21636","title":"view_component Cross-site Scripting vulnerability","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 tem","descriptionLong":"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`.","published":"2024-01-04T20:09:08.564Z","updated":"2026-10-28T02:31:09.923066831Z","reserved":"2023-12-29T03:00:44.957Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","rating":"medium","source":"GitHub_M"},"metrics":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","rating":"medium","source":"GitHub_M"},{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","rating":"medium","source":"github.com"},{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","rating":"medium","source":"NVD"},{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","rating":"medium","source":"OSV"},{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","rating":"medium","source":"GitHub"}],"rating":"medium","products":["ViewComponent view_component"],"affectedProducts":[{"vendor":"ViewComponent","product":"view_component","defaultStatus":null,"versions":[{"version":">= 3.0.0, < 3.9.0","status":"affected"},{"version":"< 2.83.0","status":"affected"}],"platforms":[]}],"packages":[{"ecosystem":"RubyGems","name":"view_component","purl":"pkg:gem/view_component","ranges":[">=3.0.0 <3.9.0","<2.83.0"],"fixed":["3.9.0","2.83.0"],"advisory":"GHSA-wf2x-8w6j-qw37"}],"cwes":["CWE-79"],"aliases":["GHSA-wf2x-8w6j-qw37"],"references":[{"url":"https://github.com/ViewComponent/view_component/security/advisories/GHSA-wf2x-8w6j-qw37","tags":["x_refsource_CONFIRM","x_transferred","Vendor Advisory","advisory","web"]},{"url":"https://github.com/ViewComponent/view_component/pull/1950","tags":["x_refsource_MISC","x_transferred","Exploit","Issue Tracking","Patch","fix","web"]},{"url":"https://github.com/ViewComponent/view_component/pull/1962","tags":["x_refsource_MISC","x_transferred","Issue Tracking","fix","web"]},{"url":"https://github.com/ViewComponent/view_component/commit/0d26944a8d2730ea40e60eae23d70684483e5017","tags":["x_refsource_MISC","x_transferred","Patch","fix","web"]},{"url":"https://github.com/ViewComponent/view_component/commit/c43d8bafa7117cbce479669a423ab266de150697","tags":["x_refsource_MISC","x_transferred","Patch","fix","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/21xxx/CVE-2024-21636.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-21636","tags":["advisory"]},{"url":"https://github.com/ViewComponent/view_component","tags":["package"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/view_component/CVE-2024-21636.yml","tags":["web"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial"},"epss":0.00495,"epssPercentile":0.43277,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2024-21636","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-21636","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2024-21636","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-wf2x-8w6j-qw37","ok":true,"note":"GHSA-wf2x-8w6j-qw37"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2024-21636","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}