CVE-2024-22191: Avo Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-ghjv-mh6x-7q6h
CVSS 7.3
CWE-79
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2024-22191
GHSA Identifier GHSA-ghjv-mh6x-7q6h
Severity HIGH
CVSS v3.1 Base Score 7.3
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Avo
Package Ecosystem RubyGems
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (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.

avo fixed: 3.2.4
Upgrade avo to 3.2.4
avo fixed: 2.47.0
Upgrade avo to 2.47.0
Verify Direct and Transitive Dependencies

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

### Summary A **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. ### Details The 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. This 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. In [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**. ### PoC ![POC](https://user-images.githubusercontent.com/26570201/295596307-5d4f563e-99c0-4981-a82e-fc42cfd902c5.gif) To reproduce the vulnerability, follow these steps: 1. Edit an entry with a key_value field. 2. Enter the following payload into the value field: ```POC\"> <script>alert( 'XSS in key_value' );</script> <strong>Outside-tag</strong``` 3. Save the entry. 4. Go to the index page and click on the eye icon next to the entry. The malicious JavaScript code will be executed and an alert box will be displayed. _On the show and edit page the alert seems not to pop up, but the strong tag breaks out of the expected html tag_ ### Impact This vulnerability could be used to steal sensitive information from victims that could be used to hijack victims' accounts or redirect them to malicious websites.

CVE-2024-22191 Affected Avo Versions

2 component(s)
Fixed Versions:
3.2.42.47.0
Product / Package Ecosystem Affected Versions Fixed Version
avo
RubyGems
≥ 3.0.0.beta1
< 3.2.4
3.2.4
avo
RubyGems
< 2.47.0
2.47.0

References

Frequently Asked Questions

What is CVE-2024-22191?
CVE-2024-22191 is a security vulnerability in Avo involving avo vulnerable to stored cross-site scripting (XSS) in key_value field under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Avo versions are affected?
Affected versions include releases prior to 3.2.4, 2.47.0 across affected packages: avo.
What version fixes CVE-2024-22191?
Upgrading to 3.2.4, 2.47.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is avo affected?
Yes, avo is affected in releases prior to 3.2.4, 2.47.0. Upgrade your dependency to 3.2.4, 2.47.0 or later.
What is the CVSS score of CVE-2024-22191?
CVE-2024-22191 has a CVSS v3.1 base score of 7.3 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2024-22191?
CVE-2024-22191 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check RubyGems dependencies for CVE-2024-22191?
Run the dependency tree command: 'inspect dependencies for avo'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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![POC](https://user-images.githubusercontent.com/26570201/295596307-5d4f563e-99c0-4981-a82e-fc42cfd902c5.gif)\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"
  }
}