Skip to main content

CVE-2022-24722 — Vulnerability in view_component — CVE Details

HIGH

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in view_component

Published March 2, 2022Updated February 16, 2024Source: OSV

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.

Check my Gemfile.lock

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:

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.

Bundler
Update view_component to 2.49.1 or later
gem install view_component -v 2.49.1
Bundler
Update view_component to 2.31.2 or later
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).

PackageFixed 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.12.31.2

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-79
    Cross-site Scripting (XSS)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 8.1 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N

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

CVSS Score
8.1

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
1.07%
EPSS percentile: 64.4

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

GHSA-cm9w-c4rj-r2cf

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Gemfile.lock