CVE-2022-24722 — Vulnerability in view_component — CVE Details
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in view_component
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (1.07%). Schedule for your next planned update.
Does your project use an affected view_component version?
Paste your Gemfile.lock to check it for CVE-2022-24722 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
This is an XSS 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.29.1 and 2.49.1 have been released and fully mitigate the vulnerability.
Avoid passing user input to the translate function, or sanitize the inputs before passing them.
For more information
If you have any questions or comments about this advisory:
- Open an issue in the github/view_component project
Advisory Timeline
- First published March 2, 2022 (1730 days ago).
- Last revised February 16, 2024 — 715 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install view_component -v 2.49.1
gem install view_component -v 2.31.2
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (2)
Affects 1 ecosystem: RubyGems (1).
| Package | Fixed In |
|---|---|
| view_component RubyGems · Affected: 2.32.0, 2.33.0, 2.34.0, 2.35.0 (+15 more) | 2.49.1 |
| view_component RubyGems · Affected: 2.31.0, 2.31.1 | 2.31.2 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-79Cross-site Scripting (XSS)MITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 8.1 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
References
- https://github.com/github/view_component/security/advisories/GHSA-cm9w-c4rj-r2cfWEB
- https://nvd.nist.gov/vuln/detail/CVE-2022-24722ADVISORY
- https://github.com/github/view_component/commit/3f82a6e62578ff6f361aba24a1feb2caccf83ff9WEB
- https://github.com/github/view_componentWEB
- https://github.com/github/view_component/releases/tag/v2.31.2WEB
- https://github.com/github/view_component/releases/tag/v2.49.1WEB
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/view_component/CVE-2022-24722.ymlWEB
Frequently Asked Questions
- What is CVE-2022-24722?
- Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in view_component. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.1/10).
- How do I check if my project is affected by CVE-2022-24722?
- CVE-2022-24722 affects view_component. It has a 1.1% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2022-24722 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is an above-median EPSS score — 64.4% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2026-126366HIGH
msgpack-ruby JRuby decoder makes uncapped header-count allocations; a 5-byte message forces multi-GiB OOM
- CVE-2026-54498HIGH
ViewComponent: around_render HTML-Safety Bypass
- CVE-2026-126081HIGH
Action Pack: Possible Strong Parameters Bypass in Parameters#each_key
- CVE-2026-44836MEDIUM
view_component: Preview Route Can Dispatch Inherited Helper Methods
- CVE-2026-54497MEDIUM
ViewComponent: Reused Component Instances Retain Stale Render Context
- CVE-2026-44837MEDIUM
view_component: System Test Entry Point Path Check Allows Sibling Directory Escape
- CVE-2024-21636MEDIUM
view_component Cross-site Scripting vulnerability