# CVE-2022-24722: Cross-site Scripting in view\_component

- Priority: **Routine**
- Reason: Not severe (CVSS 8.1, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2022-03-02 · Modified: 2025-04-23
- Aliases: GHSA-cm9w-c4rj-r2cf
- Record: https://cvemate.com/vulnerability/CVE-2022-24722 · JSON: https://cvemate.com/vulnerability/CVE-2022-24722/json

## Description

```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.
```

## Signals

- CVSS: 8.1 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
- EPSS: 1.092%, percentile 66.549%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- RubyGems view\_component (RubyGems): ≥ 2.31.0, \< 2.31.2 \| ≥ 2.32.0, \< 2.49.1
- github view\_component: ≥ 2.31.0, \< 2.31.2 \| ≥ 2.32.0, \< 2.49.1
- github viewcomponent: ≥ 2.31.0, \< 2.31.2 \| ≥ 2.32.0, \< 2.49.1

## References

- <https://github.com/github/view_component/security/advisories/GHSA-cm9w-c4rj-r2cf>
- <https://github.com/github/view_component/commit/3f82a6e62578ff6f361aba24a1feb2caccf83ff9>
- <https://github.com/github/view_component/releases/tag/v2.31.2>
- <https://github.com/github/view_component/releases/tag/v2.49.1>
- <https://nvd.nist.gov/vuln/detail/CVE-2022-24722>
- <https://github.com/github/view_component>
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/view_component/CVE-2022-24722.yml>

---

Data as of 2026-12-05T08:01:07.358Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
