CVE-2022-24722Github Viewcomponent
Medium 6.1 No auth needed
Follow: this CVE · Github · Github Viewcomponent We alert you by email or Slack (account required).
- Priority
- 52
- CVSS 3.1
- 6.1
- EPSS
- 1.1% probability of exploitation in 30 days · percentile 64
- Auth required
- No
- Published
- Mar 2, 2022
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-79
- SSVC (CISA)
- Exploitation: none · Automatable: no · Technical impact: total
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
What happens
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.
What to do
- Apply the vendor's security update for Viewcomponent.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| RubyGems | view_component |
≥ 2.31.0 < 2.31.2 |
2.31.2 |
gem "view_component", ">= 2.31.2" |
| RubyGems | view_component |
≥ 2.32.0 < 2.49.1 |
2.49.1 |
gem "view_component", ">= 2.49.1" |
Per OSV / GitHub Advisories (GHSA-cm9w-c4rj-r2cf). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| github | viewcomponent | ≥ 2.31.0 < 2.31.2 |
| github | viewcomponent | ≥ 2.32.0 < 2.49.1 |
Official sources
References
Links published by the sources. Open them with care.
- github.com Patch Third Party Advisory
- github.com Third Party Advisory
- github.com Third Party Advisory
- github.com Third Party Advisory