CVE-2024-21636

view_component Cross-site Scripting vulnerability

MEDIUM
6.1
CVSS Score
Published: January 4, 2024 at 08:09 PM UTC
Updated: June 17, 2026 at 07:09 AM UTC
1 product affected across 1 vendorViewComponent

Using view_component by ViewComponent?

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 0.5%
SSVC
No known exploit

Description

view_component is a framework for building reusable, testable, and encapsulated view components in Ruby on Rails. Versions prior to 3.9.0 and 2.83.0 have a cross-site scripting vulnerability that has the potential to impact anyone rendering a component directly from a controller with the view_component gem. Note that only components that define a `#call` method (i.e. instead of using a sidecar template) are affected. The return value of the `#call` method is not sanitized and can include user-defined content. In addition, the return value of the `#output_postamble` methodis not sanitized, which can also lead to cross-site scripting issues. Versions 3.9.0 and 2.83.0 have been released and fully mitigate both the `#call` and the `#output_postamble` vulnerabilities. As a workaround, sanitize the return value of `#call`.

Affected

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

v < 2.83.0v < 3.9.03.0.0 ≤ v < 3.9.0
Affected range stops below 2.83.0, so it looks safe — our inference, not a vendor statement
Affected range stops below 3.9.0, so it looks safe — our inference, not a vendor statement

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

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

CVSS

6.1MEDIUMGitHub_M
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