Skip to content

Commit ee0172a

Browse files
jasnowpostmodern
authored andcommitted
GHSA SYNC: 1 brand new advisory
1 parent 0a89cf8 commit ee0172a

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

gems/activeadmin/CVE-2024-37031.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
gem: activeadmin
3+
cve: 2024-37031
4+
ghsa: 9mg6-x45v-hcfm
5+
url: https://github.com/activeadmin/activeadmin/security/advisories/GHSA-9mg6-x45v-hcfm
6+
title: activeadmin vulnerable to stored persistent cross-site
7+
scripting (XSS) in dynamic form legends
8+
date: 2024-06-02
9+
description: |
10+
### Impact
11+
12+
Users settings their active admin form legends dynamically may be
13+
vulnerable to stored XSS, as long as its value can be injected
14+
directly by a malicious user.
15+
16+
For example:
17+
18+
* A public web application allows users to create entities with
19+
arbitrary names.
20+
* Active Admin is used to administrate these entities through a
21+
private backend.
22+
* The form to edit these entities in the private backend has the
23+
following shape (note the dynamic `name` value dependent on an
24+
attribute of the `resource`):
25+
26+
```ruby
27+
form do |f|
28+
f.inputs name: resource.name do
29+
f.input :name
30+
f.input :description
31+
end
32+
33+
f.actions
34+
end
35+
```
36+
37+
Then a malicious user could create an entity with a payload that
38+
would get executed in the active admin administrator's browser.
39+
40+
Both `form` blocks with an implicit or explicit name (i.e., both
41+
`form resource.name` or `form name: resource.name` would suffer
42+
from the problem), where the value of the name can be arbitrarily
43+
set by non admin users.
44+
45+
### Patches
46+
47+
The problem has been fixed in ActiveAdmin 3.2.2 and ActiveAdmin 4.0.0.beta7.
48+
49+
### Workarounds
50+
51+
Users can workaround this problem without upgrading by explicitly
52+
escaping the form name using an HTML escaping utility. For example:
53+
54+
```ruby
55+
form do |f|
56+
f.inputs name: ERB::Util.html_escape(resource.name) do
57+
f.input :name
58+
f.input :description
59+
end
60+
61+
f.actions
62+
end
63+
```
64+
Upgrading is of course recommended though.
65+
66+
### References
67+
https://owasp.org/www-community/attacks/xss/#stored-xss-attacks
68+
cvss_v3: 7.2
69+
patched_versions:
70+
- "~> 3.2.2"
71+
- ">= 4.0.0.beta7"
72+
related:
73+
url:
74+
- https://github.com/activeadmin/activeadmin/security/advisories/GHSA-9mg6-x45v-hcfm
75+
- https://github.com/activeadmin/activeadmin/pull/8349
76+
- https://owasp.org/www-community/attacks/xss/#stored-xss-attacks
77+
- https://github.com/advisories/GHSA-9mg6-x45v-hcfm

0 commit comments

Comments
 (0)