CVE-2023-34103: Avo Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-5cr9-5jx3-2g39
CVSS 7.3
CWE-79
Published
Advisory Summary

CVE-2023-34103 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 xss (cross site scripting) in html content based fields. Remediation is available by upgrading affected packages to version 2.33.3.

CVE-2023-34103 at a Glance

CVE Identifier CVE-2023-34103
GHSA Identifier GHSA-5cr9-5jx3-2g39
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-2023-34103

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: 2.33.3
Upgrade avo to 2.33.3
avo fixed: Latest secure release
Upgrade avo to Latest secure release
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-2023-34103, 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 2.33.3), 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 Some avo fields are vulnerable to XSS when rendering html based content. ### Details During the analysis of the web application, a rendered field was discovered that did not filter JS / HTML tags in a safe way and can be abused to execute js code on a client side. The trix field uses the trix editor in the backend to edit rich text data which basically operates with html tags. To display the stored data in a rendered view, the HasHTMLAttributes concern is used. This can be exploited by an attacker to store javascript code in any trix field by intercepting the request and modifying the post data, as the trix editor does not allow adding custom html or js tags on the frontend. ### PoC ![image](https://user-images.githubusercontent.com/26464774/243434868-47857054-9b20-437f-842f-0750d53c9b0e.png) _Adding javascript in the post request which is used when editing a "post" resource (body is declared as a trix field)_ ![image](https://user-images.githubusercontent.com/26464774/243435009-948593a0-5179-4368-977c-ec36d2373925.png) _Successful execution of JS code on live demo environment_ ### Impact Unlike non-persistent XSS, persistent XSS does not require a social engineering phase. Victims of this attack do not need to be tricked into clicking a link or something like that. However, by exploiting such a vulnerability on this particular target, attackers may be able to gain access to accounts that require special protection, such as administrators of the web service, which is what Avo is primarily intended to be used for. ### Recommendation The content of a field that contains html code should be sanitized using the according rails helper which uses a whitelist of known-safe tags and attributes. Also this security consideration should be applied to the “as_html” attribute as well because it may contain user controlled input as well. https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html

CVE-2023-34103 Affected Avo Versions

2 component(s)
Fixed Versions:
2.33.3
Product / Package Ecosystem Affected Versions Fixed Version
avo
RubyGems
< 2.33.3
2.33.3
avo
RubyGems
≥ 3.0.0.pre1
≤ 3.0.0.pre12

References

Frequently Asked Questions

What is CVE-2023-34103?
CVE-2023-34103 is a security vulnerability in Avo involving avo vulnerable to Stored XSS (Cross Site Scripting) in html content based fields 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 2.33.3 across affected packages: avo.
What version fixes CVE-2023-34103?
Upgrading to 2.33.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is avo affected?
Yes, avo is affected in releases prior to 2.33.3, Latest secure release. Upgrade your dependency to 2.33.3, Latest secure release or later.
What is the CVSS score of CVE-2023-34103?
CVE-2023-34103 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-2023-34103?
CVE-2023-34103 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-2023-34103?
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-5cr9-5jx3-2g39",
  "modified" : "2024-06-25T16:56:41Z",
  "published" : "2023-06-06T14:13:08Z",
  "aliases" : [ "CVE-2023-34103" ],
  "summary" : "avo vulnerable to Stored XSS (Cross Site Scripting) in html content based fields",
  "details" : "### Summary\nSome avo fields are vulnerable to XSS when rendering html based content.\n\n### Details\nDuring the analysis of the web application, a rendered field was discovered that did not filter JS / HTML tags in a safe way and can be abused to execute js code on a client side. The trix field uses the trix editor in the backend to edit rich text data which basically operates with html tags. To display the stored data in a rendered view, the HasHTMLAttributes concern is used. This can be exploited by an attacker to store javascript code in any trix field by intercepting the request and modifying the post data, as the trix editor does not allow adding custom html or js tags on the frontend.\n\n### PoC\n![image](https://user-images.githubusercontent.com/26464774/243434868-47857054-9b20-437f-842f-0750d53c9b0e.png)\n_Adding javascript in the post request which is used when editing a \"post\" resource (body is declared as a trix field)_\n\n![image](https://user-images.githubusercontent.com/26464774/243435009-948593a0-5179-4368-977c-ec36d2373925.png)\n_Successful execution of JS code on live demo environment_\n\n### Impact\nUnlike non-persistent XSS, persistent XSS does not require a social engineering phase. Victims of this attack do not need to be tricked into clicking a link or something like that. However, by exploiting such a vulnerability on this particular target, attackers may be able to gain access to accounts that require special protection, such as administrators of the web service, which is what Avo is primarily intended to be used for.\n\n### Recommendation\nThe content of a field that contains html code should be sanitized using the according rails helper which uses a whitelist of known-safe tags and attributes. Also this security consideration should be applied to the “as_html” attribute as well because it may contain user controlled input as well.\n\nhttps://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html\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" : "0"
      }, {
        "fixed" : "2.33.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.33.2"
    }
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "avo"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0.pre1"
      }, {
        "last_affected" : "3.0.0.pre12"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/avo-hq/avo/security/advisories/GHSA-5cr9-5jx3-2g39"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-34103"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/avo-hq/avo/commit/7891c01e1fba9ca5d7dbccc43d27f385e5d08563"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/avo-hq/avo"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/avo-hq/avo/releases/tag/v2.33.3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/avo/CVE-2023-34103.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-06T14:13:08Z",
    "nvd_published_at" : "2023-06-05T23:15:12Z"
  }
}