CVE-2023-34102: Avo Denial of Service Vulnerability
HIGHCVE-2023-34102 is a HIGH (CVSS 8.3) denial of service vulnerability (CWE-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')) affecting Avo libraries in the RubyGems ecosystem. The issue involves avo possible unsafe reflection / partial dos vulnerability. Remediation is available by upgrading affected packages to version 2.33.3.
CVE-2023-34102 at a Glance
Security Impact
CVSS: 8.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:N/S:U/C:L/I:H/A:H).
How to Fix CVE-2023-34102
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 2.33.3
Upgrade avo to Latest secure release
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-34102, 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-470: Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection'), where the product uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code. 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-2023-34102 Affected Avo Versions
2 component(s)References
Frequently Asked Questions
What is CVE-2023-34102?
Which Avo versions are affected?
What version fixes CVE-2023-34102?
Is avo affected?
What is the CVSS score of CVE-2023-34102?
What CWE is associated with CVE-2023-34102?
How can I check RubyGems dependencies for CVE-2023-34102?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-86h2-2g4g-29qx",
"modified" : "2024-06-25T16:56:30Z",
"published" : "2023-06-06T16:46:57Z",
"aliases" : [ "CVE-2023-34102" ],
"summary" : "avo possible unsafe reflection / partial DoS vulnerability",
"details" : "### Summary\nThe polymorphic field type stores the classes to operate on when updating a record with user input, and does not validate them in the back end. This can lead to unexpected behavior, remote code execution, or application crashes when viewing a manipulated record. \n\n### Details\nAfter reviewing the polymorphic field implementation and performing some black box approaches, we identified a potential security issue related to the use of safe_constantize / constantize. This Rails functionality is capable of searching for classes within the Rails context and returning the class for further use. Because Avo does not validate user input when updating or creating a new polymorphic resource, it is possible to create database entries with completely different or invalid class names than the preselected ones. Avo assumes that the class specified by the user request is a valid one and attempts to work with it, which may result in dangerous behavior and code execution.\n\n### PoC\n\n_In the test scenario we choose the demo app and the review resource which has a polymorphic reviewable field._\n\n\n_Intercepting the request and switching the review[reviewable_type] from “Fish” to “File” which is a real class inside Rails_\n\n\n_Corrupting the database with unusable classes will cause a crash at the application while viewing the new record or the index view (partial DoS)_\n\n\n_Manual delete the corrupted resource in order to recover the applications functionality_\n\n\n_Of course it is possible to use other class names or namespaces. The local development environment displays the backend error message when visiting a corrupted record. Avo is trying to apply a scope to this class that does not exist._\n\n\n_Specifying an invalid class name in the parameter will cause the application to crash again while trying constanize the provided string_\n\n### Impact\nThe final exploitation of this vulnerability requires more time than is provided in this assessment, but initial testing of the post request shows the potential critical risk. The classes could be instantiated at any point in the code and this could also lead to code execution.\n\n### Recommendation\nAvo should be configured to never trust user-supplied input, especially when defining classes for records. In this particular case, Avo can evaluate the options list given for the polymorphic field and only allow strings from that list. With this white-list approach, an attacker cannot supply unintended classes.\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H"
} ],
"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-86h2-2g4g-29qx"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-34102"
}, {
"type" : "WEB",
"url" : "https://github.com/avo-hq/avo/commit/ec117882ddb1b519481bdd046dc3cfa4474e6e17"
}, {
"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-34102.yml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-470" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-06-06T16:46:57Z",
"nvd_published_at" : "2023-06-05T23:15:12Z"
}
}