{"schemaVersion":3,"id":"CVE-2022-24722","aliases":["GHSA-cm9w-c4rj-r2cf"],"status":"published","duplicateOf":null,"title":null,"description":"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.","dates":{"published":"2022-03-02T22:40:11.000Z","modified":"2025-04-23T18:59:13.837Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":8.1,"severity":"high","version":"3.1","versionLabel":"v3.1","source":"CVE.org","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":8.1,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Rubygems","score":8.1,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","exploitability":7.2,"impact":8.7,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":6.1,"severity":"medium","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","exploitability":null,"impact":null,"computed":false},{"version":"2.0","versionLabel":"v2.0","source":"NVD","score":4.3,"severity":"medium","vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.01092,"percentile":0.6493,"severity":"low","asOf":"2026-10-20T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-09-20T00:00:00.000Z","baselineScore":0.01092},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.01092,"percentile":0.6493}],"last30":[{"date":"2026-09-20T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.01092,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.01092,"percentile":0.6493}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[],"exploitCount":0,"weaknesses":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')","description":"The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.","type":"weakness","status":"Stable","abstraction":"Base","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/79.html"}],"affected":[{"vendor":"RubyGems","product":"view_component","name":"view_component","label":"view_component","ecosystem":"RubyGems","cpePart":null,"purl":"pkg:gem/view_component","purlType":"gem","versions":[{"text":"≥ 2.31.0, < 2.31.2","noFixRecorded":false,"fixedIn":null},{"text":"≥ 2.32.0, < 2.49.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 2.31.0, < 2.31.2 | ≥ 2.32.0, < 2.49.1","eol":null,"hubHref":null},{"vendor":"github","product":"view_component","name":"view_component","label":"view_component","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 2.31.0, < 2.31.2","noFixRecorded":false,"fixedIn":null},{"text":"≥ 2.32.0, < 2.49.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 2.31.0, < 2.31.2 | ≥ 2.32.0, < 2.49.1","eol":null,"hubHref":"/vendor/github/view_component"},{"vendor":"github","product":"viewcomponent","name":"viewcomponent","label":"viewcomponent","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 2.31.0, < 2.31.2","noFixRecorded":false,"fixedIn":null},{"text":"≥ 2.32.0, < 2.49.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 2.31.0, < 2.31.2 | ≥ 2.32.0, < 2.49.1","eol":null,"hubHref":"/vendor/github/viewcomponent"}],"affectedCount":3,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/github/view_component/security/advisories/GHSA-cm9w-c4rj-r2cf","label":"github.com/github/view_component/security/advisories/GHSA-cm9w-c4rj-r2cf","hostname":"github.com","tags":["X Refsource CONFIRM","WEB","Third Party Advisory"]},{"url":"https://github.com/github/view_component/commit/3f82a6e62578ff6f361aba24a1feb2caccf83ff9","label":"github.com/github/view_component/commit/3f82a6e62578ff6f361aba24a1feb2caccf83ff9","hostname":"github.com","tags":["X Refsource MISC","WEB","Patch","Third Party Advisory"]},{"url":"https://github.com/github/view_component/releases/tag/v2.31.2","label":"github.com/github/view_component/releases/tag/v2.31.2","hostname":"github.com","tags":["X Refsource MISC","WEB","Third Party Advisory"]},{"url":"https://github.com/github/view_component/releases/tag/v2.49.1","label":"github.com/github/view_component/releases/tag/v2.49.1","hostname":"github.com","tags":["X Refsource MISC","WEB","Third Party Advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24722","label":"nvd.nist.gov/vuln/detail/CVE-2022-24722","hostname":"nvd.nist.gov","tags":["Advisory"]},{"url":"https://github.com/github/view_component","label":"github.com/github/view_component","hostname":"github.com","tags":["WEB"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/view_component/CVE-2022-24722.yml","label":"github.com/rubysec/ruby-advisory-db/blob/master/gems/view_component/CVE-2022-24722.yml","hostname":"github.com","tags":["WEB"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2022-03-02T22:40:11.000Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2025-04-23T18:59:13.837Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":33,"level":"medium","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-20T23:15:46.665Z","stale":false,"partial":false}}