GitHub Advisoryadvisory · RubyGems
GHSA-ghjv-mh6x-7q6h avo vulnerable to stored cross-site scripting (XSS) in key_value field
HIGH
Official page ↗
- Aliases
- CVE-2024-22191
- Ecosystem
- RubyGems
- Packages
- avo
- Severity
- High
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N
- Weaknesses
- CWE-79
- Reviewed
- 2024-01-16
Affected packages
• RubyGems avo: >= 3.0.0.beta1, < 3.2.4 → fixed in 3.2.4
• RubyGems avo: < 2.47.0 → fixed in 2.47.0
Description
Summary
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.
Details
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/key_value_component.html.erb the value is taken in lines 38 and 49 and seems to be interpreted directly as html in lines 44 and 55.
PoC
To reproduce the vulnerability, follow these steps:
1. Edit an entry with a key_value field.
2. Enter the following payload into the value field:
```POC\"> alert( 'XSS in key_value' ); Outside-tag</strong```
3. Save the entry.
4. Go to the index page and click on the eye icon next to the entry.
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_
Impact
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.
Related
Alias · CVE (1)
- CVE-2024-22191 Avo is a framework to create admin panels for Ruby on Rails apps. vulnerability
Weakness · CWE (1)
- CWE-79 Improper Neutralization of Input During Web Page Generation weakness
References
- https://github.com/avo-hq/avo/security/advisories/GHSA-ghjv-mh6x-7q6h web
- https://nvd.nist.gov/vuln/detail/CVE-2024-22191 advisory
- https://github.com/avo-hq/avo/commit/51bb80b181cd8e31744bdc4e7f9b501c81172347 web
- https://github.com/avo-hq/avo/commit/fc92a05a8556b1787c8694643286a1afa6a71258 web
- https://github.com/avo-hq/avo package
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/avo/CVE-2024-22191.yml web