CVE-2024-22191: Avo Cross-Site Scripting Vulnerability
HIGHCVE-2024-22191 is a HIGH (CVSS 7.3) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Avo libraries in the RubyGems ecosystem. The issue involves avo vulnerable to stored cross-site scripting (xss) in key_value field. Remediation is available by upgrading affected packages to version 3.2.4, 2.47.0.
CVE-2024-22191 at a Glance
Security Impact
CVSS: 7.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N).
How to Fix CVE-2024-22191
To remediate this vulnerability, upgrade all affected Avo 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 avo to 3.2.4
Upgrade avo to 2.47.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for avo
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-22191, inspect your project dependencies for Avo:
inspect dependencies for avo
Analyze the terminal output to locate any version of Avo in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.2.4), 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 Avo, 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-2024-22191 Affected Avo Versions
2 component(s)References
Frequently Asked Questions
What is CVE-2024-22191?
Which Avo versions are affected?
What version fixes CVE-2024-22191?
Is avo affected?
What is the CVSS score of CVE-2024-22191?
What CWE is associated with CVE-2024-22191?
How can I check RubyGems dependencies for CVE-2024-22191?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-ghjv-mh6x-7q6h",
"modified" : "2024-06-25T16:56:00Z",
"published" : "2024-01-16T15:24:00Z",
"aliases" : [ "CVE-2024-22191" ],
"summary" : "avo vulnerable to stored cross-site scripting (XSS) in key_value field",
"details" : "### Summary\nA **stored cross-site scripting (XSS)** vulnerability was found in the **key_value** field of Avo v3.2.3. This vulnerability could allow an attacker to execute arbitrary JavaScript code in the victim's browser.\n\n### Details\nThe value of the key_value is inserted directly into the HTML code. In the current version of Avo (possibly also older versions), the value is not properly sanitized before it is inserted into the HTML code.\n\nThis vulnerability can be exploited by an attacker to inject malicious JavaScript code into the key_value field. When a victim views the page containing the malicious code, the code will be executed in their browser.\n\nIn [avo/fields/common/key_value_component.html.erb]( https://github.com/avo-hq/avo/blob/main/app/components/avo/fields/common/key_value_component.html.erb#L38C21-L38C33) the value is taken in lines **38** and **49** and seems to be interpreted directly as html in lines **44** and **55**.\n\n### PoC\n\n\n\n\nTo reproduce the vulnerability, follow these steps:\n\n1. Edit an entry with a key_value field.\n2. Enter the following payload into the value field:\n```POC\\\"> <script>alert( 'XSS in key_value' );</script> <strong>Outside-tag</strong```\n3. Save the entry.\n4. Go to the index page and click on the eye icon next to the entry.\n\nThe malicious JavaScript code will be executed and an alert box will be displayed. \n_On the show and edit page the alert seems not to pop up, but the strong tag breaks out of the expected html tag_\n\n### Impact\nThis vulnerability could be used to steal sensitive information from victims that could be used to hijack victims' accounts or redirect them to malicious websites.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "RubyGems",
"name" : "avo"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0.beta1"
}, {
"fixed" : "3.2.4"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.2.3"
}
}, {
"package" : {
"ecosystem" : "RubyGems",
"name" : "avo"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.47.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.46.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/avo-hq/avo/security/advisories/GHSA-ghjv-mh6x-7q6h"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-22191"
}, {
"type" : "WEB",
"url" : "https://github.com/avo-hq/avo/commit/51bb80b181cd8e31744bdc4e7f9b501c81172347"
}, {
"type" : "WEB",
"url" : "https://github.com/avo-hq/avo/commit/fc92a05a8556b1787c8694643286a1afa6a71258"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/avo-hq/avo"
}, {
"type" : "WEB",
"url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/avo/CVE-2024-22191.yml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-01-16T15:24:00Z",
"nvd_published_at" : "2024-01-16T22:15:46Z"
}
}