Lucene search

K
rubygemsRubySecRUBY:AVO-2023-34102
HistoryJun 05, 2023 - 9:00 p.m.

avo possible unsafe reflection / partial DoS vulnerability

2023-06-0521:00:00
RubySec
github.com
6
avo
polymorphic field
user input validation
remote code execution
dos vulnerability
recommendation
class evaluation

CVSS3

8.8

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

AI Score

7.7

Confidence

Low

Summary

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

Details

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

Impact

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

Recommendation

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

Affected configurations

Vulners
Node
rubyavoRange2.33.3
VendorProductVersionCPE
rubyavo*cpe:2.3:a:ruby:avo:*:*:*:*:*:*:*:*

CVSS3

8.8

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

HIGH

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

AI Score

7.7

Confidence

Low

Related for RUBY:AVO-2023-34102