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

    Threat Intelligence

    EPSS
    0.05% (22nd 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 ID SNYK-RUBY-VIEWCOMPONENT-6144786
  • published 5 Jan 2024
  • disclosed 4 Jan 2024
  • credit Blake Williams

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
Expand this section

Snyk

Recommended
6.1 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    Required
  • Scope (S)
    Changed
  • Confidentiality (C)
    Low
  • Integrity (I)
    Low
  • Availability (A)
    None
Expand this section

NVD

6.1 medium