CVE-2022-24722

Cross-site Scripting in view_component

MEDIUM
6.1
CVSS Score
Published: March 2, 2022 at 10:40 PM UTC
Updated: June 17, 2026 at 04:32 AM UTC
1 product affected across 1 vendorViewcomponent

Using view_component by github?

Get instant alerts when new vulnerabilities affect view_component - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM6.1
Exploit prediction
EPSS 1%
SSVC
No known exploit

Description

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

95%
v < 2.31.2v < 2.49.12.31.0 ≤ v < 2.31.22.32.0 ≤ v < 2.49.1
Affected range stops below 2.31.2, so it looks safe — our inference, not a vendor statement
Affected range stops below 2.49.1, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

SSVC — Action Prioritization

SSVCNo known exploitNot automatableTotal impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
REQUIRED
Scope
CHANGED
Confidentiality
LOW
Integrity
LOW
Availability
NONE
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-79

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card