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.
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/keyvaluecomponent.html.erb the value is taken in lines 38 and 49 and seems to be interpreted directly as html in lines 44 and 55.
To reproduce the vulnerability, follow these steps:
POC\"> <script>alert( 'XSS in key_value' );</script> <strong>Outside-tag</strong
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
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.
{ "nvd_published_at": "2024-01-16T22:15:46Z", "cwe_ids": [ "CWE-79" ], "severity": "HIGH", "github_reviewed": true, "github_reviewed_at": "2024-01-16T15:24:00Z" }