Lucene search

K
githubGitHub Advisory DatabaseGHSA-5CR9-5JX3-2G39
HistoryJun 06, 2023 - 2:13 p.m.

avo vulnerable to Stored XSS (Cross Site Scripting) in html content based fields

2023-06-0614:13:08
CWE-79
GitHub Advisory Database
github.com
9
xss
html
javascript
web application
security
ruby on rails

7.3 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

REQUIRED

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

NONE

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

0.001 Low

EPSS

Percentile

23.7%

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
Adding javascript in the post request which is used when editing a “post” resource (body is declared as a trix field)

image
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

Affected configurations

Vulners
Node
avo-hqavoRange3.0.0.pre12
OR
avo-hqavoRange2.33.2
CPENameOperatorVersion
avole3.0.0.pre12
avole2.33.2

7.3 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

REQUIRED

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

HIGH

Availability Impact

NONE

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

0.001 Low

EPSS

Percentile

23.7%

Related for GHSA-5CR9-5JX3-2G39