CVE-2022-24722
Cross-site Scripting in view_component
- Published
- Updated
- Reserved
- Assigned by
- GitHub_M
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.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| GitHub_MCNA (assigner) | 3.1 | High8.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N |
| NVDNVD · Modified | 3.1 | Medium6.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
- EPSS (exploitation in 30 days)
- 1.1% · top 34% of all CVEs (6 Nov 2026)
- CISA SSVC
- Exploitation: none · Automatable: no · Technical impact: total
The list uses the assigner's score when there is one, then CISA's, then NVD's: High 8.1.
Weakness
Affected products
- affected >= 2.31.0, < 2.31.2
- affected >= 2.32.0, < 2.49.1
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- RubyGemsview_componentGHSA-cm9w-c4rj-r2cf (opens in a new tab)
References (4)
- https://github.com/github/view_component/security/advisories/GHSA-cm9w-c4rj-r2cf (opens in a new tab)x_refsource_CONFIRMx_transferred
- https://github.com/github/view_component/commit/3f82a6e62578ff6f361aba24a1feb2caccf83ff9 (opens in a new tab)x_refsource_MISCx_transferred
- https://github.com/github/view_component/releases/tag/v2.31.2 (opens in a new tab)x_refsource_MISCx_transferred
- https://github.com/github/view_component/releases/tag/v2.49.1 (opens in a new tab)x_refsource_MISCx_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-cm9w-c4rj-r2cf (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://trackcve.app/cve/CVE-2022-24722)Record last updated .