{"id":"CVE-2022-24722","aliases":["CVE-2022-24722","GHSA-cm9w-c4rj-r2cf"],"related":[],"kind":"vulnerability","state":"published","title":"Cross-site Scripting in view_component","summary":"VIewComponent is a framework for building view components in Ruby on Rails. Versions prior to 2.31.2 and 2.49.1 contain a cross-site scripting vulnerability that has the potential to impact anyone using translations with the view_component gem. Data received via user input and passed as an interpolation argument to the `translate` method is not properly sanitized before display. Versions 2.31.2 and 2.49.1 have been released and fully mitigate the vulnerability. As a workaround, avoid passing user input to the `translate` function, or sanitize the inputs before passing them.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"VIewComponent is a framework for building view components in Ruby on Rails. Versions prior to 2.31.2 and 2.49.1 contain a cross-site scripting vulnerability that has the potential to impact anyone using translations with the view_component gem. Data received via user input and passed as an interpolation argument to the `translate` method is not properly sanitized before display. Versions 2.31.2 and 2.49.1 have been released and fully mitigate the vulnerability. As a workaround, avoid passing user input to the `translate` function, or sanitize the inputs before passing them.","source":"cvelist"},{"lang":"en","text":"This is an XSS vulnerability that has the potential to impact anyone using translations with the view_component gem. Data received via user input and passed as an interpolation argument to the `translate` method is not properly sanitized before display.\n\nVersions 2.29.1 and 2.49.1 have been released and fully mitigate the vulnerability.\n\nAvoid passing user input to the `translate` function, or sanitize the inputs before passing them.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in the [github/view_component](http://github.com/github/view_component) project","format":"markdown","source":"ghsa"},{"lang":"es","text":"VIewComponent es un framework para construir componentes de visualización en Ruby on Rails. Las versiones anteriores a 2.31.2 y 2.49.1 contienen una vulnerabilidad de tipo cross-site scripting que presenta el potencial de afectar a cualquiera usando traducciones con la gema view_component. Los datos recibidos por medio de la entrada del usuario y pasados como argumento de interpolación al método \"translate\" no son saneados apropiadamente antes de ser mostrados. Las versiones 2.31.2 y 2.49.1 han sido publicadas y mitigan completamente la vulnerabilidad. Como medida de mitigación, evite pasar entradas del usuario a la función \"translate\", o sanee las entradas antes de pasarlas","source":"nvd"}],"published":"2022-03-02T22:24:05.000Z","modified":"2026-06-17T04:32:22.350Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","score":8.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","score":8.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","score":8.1,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS: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,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":">= 2.31.0, < 2.31.2","status":"affected"},{"version":">= 2.32.0, < 2.49.1","status":"affected"}],"vendor":"github","product":"view_component","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.31.0","status":"affected","fixed":"2.31.2"}],"ecosystem":"RubyGems","package":"view_component","purl":"pkg:gem/view_component","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.32.0","status":"affected","fixed":"2.49.1"}],"ecosystem":"RubyGems","package":"view_component","purl":"pkg:gem/view_component","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"2.31.0","fixed":"2.31.2"},{"status":"affected","introduced":"2.32.0","fixed":"2.49.1"}],"vendor":"github","product":"viewcomponent","cpe":"cpe:2.3:a:github:viewcomponent:*:*:*:*:*:ruby_on_rails:*:*","source":"nvd"}],"references":[{"url":"https://github.com/github/view_component/security/advisories/GHSA-cm9w-c4rj-r2cf","tags":["third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/github/view_component/commit/3f82a6e62578ff6f361aba24a1feb2caccf83ff9","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/github/view_component/releases/tag/v2.31.2","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/github/view_component/releases/tag/v2.49.1","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24722","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/github/view_component","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/view_component/CVE-2022-24722.yml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2025-04-23T15:55:32.558Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-24722","url":"https://www.cve.org/CVERecord?id=CVE-2022-24722","licence":"CVE Terms of Use","modified":"2025-04-23T18:59:13.837Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cm9w-c4rj-r2cf","url":"https://github.com/advisories/GHSA-cm9w-c4rj-r2cf","licence":"CC-BY-4.0","modified":"2024-02-16T07:51:13.975Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-24722","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24722","licence":"Public domain","modified":"2026-06-17T04:32:22.350Z"}],"updatedAt":"2026-11-25T22:58:09.890Z","epss":{"score":0.01092,"percentile":0.66421,"date":"2026-12-02T12:00:21.000Z"}}