/
CVE-2024-22191.yml
64 lines (47 loc) · 2.4 KB
/
CVE-2024-22191.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
---
gem: avo
cve: 2024-22191
ghsa: ghjv-mh6x-7q6h
url: https://github.com/avo-hq/avo/security/advisories/GHSA-ghjv-mh6x-7q6h
title: avo vulnerable to stored cross-site scripting (XSS) in key_value field
date: 2024-01-16
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](https://github.com/avo-hq/avo/blob/main/app/components/avo/fields/common/key_value_component.html.erb#L38C21-L38C33)
the value is taken in lines **38** and **49** and seems to be
interpreted directly as html in lines **44** and **55**.
### PoC
![POC](https://user-images.githubusercontent.com/26570201/295596307-5d4f563e-99c0-4981-a82e-fc42cfd902c5.gif)
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\\\"> <script>alert('XSS in key_value' );</script> <strong>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.
cvss_v3: 7.3
patched_versions:
- ">= 3.2.4"
- "~> 2.47, >= 2.47"
related:
url:
- https://github.com/avo-hq/avo/security/advisories/GHSA-ghjv-mh6x-7q6h
- https://github.com/avo-hq/avo/commit/51bb80b181cd8e31744bdc4e7f9b501c81172347
- https://github.com/avo-hq/avo/commit/fc92a05a8556b1787c8694643286a1afa6a71258
- https://github.com/advisories/GHSA-ghjv-mh6x-7q6h