Cross-site Scripting in view_component
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- High · High · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| GitHub | view_component | 2.31.0 to before 2.31.2; 2.32.0 to before 2.49.1 | 2.31.2, 2.49.1 | Patch available | CNA |
| — | view_component (RubyGems) | 2.31.0 to before 2.31.2 | 2.31.2 | Patch available | GHSA-cm9w-c4rj-r2cf |
| — | view_component (RubyGems) | 2.32.0 to before 2.49.1 | 2.49.1 | Patch available | GHSA-cm9w-c4rj-r2cf |
- view_component VendorGitHub Affected 2.31.0 to before 2.31.2; 2.32.0 to before 2.49.1 Fixed in 2.31.2, 2.49.1 Patch available CNA
- view_component (RubyGems) Vendor— Affected 2.31.0 to before 2.31.2 Fixed in 2.31.2 Patch available GHSA-cm9w-c4rj-r2cf
- view_component (RubyGems) Vendor— Affected 2.32.0 to before 2.49.1 Fixed in 2.49.1 Patch available GHSA-cm9w-c4rj-r2cf
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:github:viewcomponent:*:*:*:*:*:ruby_on_rails:*:* | 2.31.0 to before 2.31.2; 2.32.0 to before 2.49.1 | Vulnerable | GitHub |
- cpe:2.3:a:github:viewcomponent:*:*:*:*:*:ruby_on_rails:*:* Versions 2.31.0 to before 2.31.2; 2.32.0 to before 2.49.1 Vulnerable ·GitHub
Remediation
- Fix · CNA view_component (github) Fixed in 2.31.2, 2.49.1
- Fix · GHSA-cm9w-c4rj-r2cf view_component (RubyGems) Fixed in 2.31.2 Advisory →
- Fix · GHSA-cm9w-c4rj-r2cf view_component (RubyGems) Fixed in 2.49.1 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2022-24722
- 2026-10-03 Alias added: GHSA-cm9w-c4rj-r2cf
References
Advisory 4
Sources
- CVE-2022-24722 · CVE Program
- CVE-2022-24722 · NVD
- FIRST EPSS
- GHSA-cm9w-c4rj-r2cf · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences