CVE-2022-24722: View component Cross-Site Scripting Vulnerability
HIGHCVE-2022-24722 is a HIGH (CVSS 8.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting View component libraries in the RubyGems ecosystem. The issue involves improper neutralization of input during web page generation ('cross-site scripting') in view_component. Remediation is available by upgrading affected packages to version 2.31.2, 2.49.1.
CVE-2022-24722 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N).
How to Fix CVE-2022-24722
To remediate this vulnerability, upgrade all affected View component dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade view_component to 2.31.2
Upgrade view_component to 2.49.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for view_component
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-24722, inspect your project dependencies for View component:
inspect dependencies for view_component
Analyze the terminal output to locate any version of View component in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.31.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In View component, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-24722 Affected View component Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
view_component
|
RubyGems |
≥ 2.31.0
< 2.31.2
|
2.31.2
|
|
view_component
|
RubyGems |
≥ 2.32.0
< 2.49.1
|
2.49.1
|
References
Frequently Asked Questions
What is CVE-2022-24722?
Which View component versions are affected?
What version fixes CVE-2022-24722?
Is view_component affected?
What is the CVSS score of CVE-2022-24722?
What CWE is associated with CVE-2022-24722?
How can I check RubyGems dependencies for CVE-2022-24722?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cm9w-c4rj-r2cf",
"modified" : "2022-03-11T20:08:41Z",
"published" : "2022-03-02T22:24:05Z",
"aliases" : [ "CVE-2022-24722" ],
"summary" : "Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in view_component",
"details" : "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.\n\nVersions 2.29.1 and 2.49.1 have been released and fully mitigate the vulnerability.\n\nAvoid passing user input to the `translate` function, or sanitize the inputs before passing them.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in the [github/view_component](http://github.com/github/view_component) project\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "view_component"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.31.0"
}, {
"fixed" : "2.31.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "view_component"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.32.0"
}, {
"fixed" : "2.49.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/github/view_component/security/advisories/GHSA-cm9w-c4rj-r2cf"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24722"
}, {
"type" : "WEB",
"url" : "https://github.com/github/view_component/commit/3f82a6e62578ff6f361aba24a1feb2caccf83ff9"
}, {
"type" : "WEB",
"url" : "https://github.com/github/view_component"
}, {
"type" : "WEB",
"url" : "https://github.com/github/view_component/releases/tag/v2.31.2"
}, {
"type" : "WEB",
"url" : "https://github.com/github/view_component/releases/tag/v2.49.1"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/view_component/CVE-2022-24722.yml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-03-02T22:24:05Z",
"nvd_published_at" : "2022-03-02T23:15:00Z"
}
}