CVE-2022-24722 is a high-severity (CVSS 8.1) Cross-site Scripting (XSS) vulnerability in view_component. A fix is available for view_component — see the affected versions and patch details below.
Cross-site Scripting in view_component
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2022-24722.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2022-24722 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 385,386 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
view_component💎view_componentReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects RubyGems packages — download data is not available via public APIs for these ecosystems.
Description
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
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 💎RubyGems | view_component | ≥ 2.31.0&&< 2.31.2 | 2.31.2bundle update view_component --conservative |
| 💎RubyGems | view_component | ≥ 2.32.0&&< 2.49.1 | 2.49.1bundle update view_component --conservative |
Affected Products
viewcomponentgithubDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for view_component, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update view_component to 2.31.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2022-24722 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is CVE-2022-24722 in your dependencies?
Find it across RubyGems, including transitive dependencies.