Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') Affecting view_component package, versions <2.83.0>=3.0.0, <3.9.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.06% (29th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-RUBY-VIEWCOMPONENT-6144786
  • published5 Jan 2024
  • disclosed4 Jan 2024
  • creditBlake Williams

Introduced: 4 Jan 2024

CVE-2024-21636  (opens in a new tab)
CWE-79  (opens in a new tab)

How to fix?

Upgrade view_component to version 2.83.0, 3.9.0 or higher.

Overview

Affected versions of this package are vulnerable to Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') via the #call and #output_postamble methods. An attacker can inject malicious scripts that may be executed in the context of the user's browser session by including user-defined content that is not properly sanitized.

Note:

This is exploitable via the #call method only if a component that defines it is rendered directly from a controller.

Workaround

This vulnerability can be mitigated by sanitizing the return value of #call.

CVSS Scores

version 3.1