GHSA-9mg6-x45v-hcfm

Suggest an improvement
Source
https://github.com/advisories/GHSA-9mg6-x45v-hcfm
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/06/GHSA-9mg6-x45v-hcfm/GHSA-9mg6-x45v-hcfm.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-9mg6-x45v-hcfm
Aliases
Published
2024-06-02T22:32:24Z
Modified
2024-10-28T13:04:48.922365Z
Severity
  • 7.2 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N CVSS Calculator
Summary
activeadmin vulnerable to stored persistent cross-site scripting (XSS) in dynamic form legends
Details

Impact

Users settings their active admin form legends dynamically may be vulnerable to stored XSS, as long as its value can be injected directly by a malicious user.

For example:

  • A public web application allows users to create entities with arbitrary names.
  • Active Admin is used to administrate these entities through a private backend.
  • The form to edit these entities in the private backend has the following shape (note the dynamic name value dependent on an attribute of the resource):
      form do |f|
        f.inputs name: resource.name do
          f.input :name
          f.input :description
        end
    
        f.actions
      end
    

Then a malicious user could create an entity with a payload that would get executed in the active admin administrator's browser.

Both form blocks with an implicit or explicit name (i.e., both form resource.name or form name: resource.name would suffer from the problem), where the value of the name can be arbitrarily set by non admin users.

Patches

The problem has been fixed in ActiveAdmin 3.2.2 and ActiveAdmin 4.0.0.beta7.

Workarounds

Users can workaround this problem without upgrading by explicitly escaping the form name using an HTML escaping utility. For example:

  form do |f|
    f.inputs name: ERB::Util.html_escape(resource.name) do
      f.input :name
      f.input :description
    end

    f.actions
  end

Upgrading is of course recommended though.

References

https://owasp.org/www-community/attacks/xss/#stored-xss-attacks

Database specific
{
    "nvd_published_at": "2024-06-03T06:15:10Z",
    "cwe_ids": [
        "CWE-79"
    ],
    "severity": "HIGH",
    "github_reviewed": true,
    "github_reviewed_at": "2024-06-02T22:32:24Z"
}
References

Affected packages

RubyGems / activeadmin

Package

Name
activeadmin
Purl
pkg:gem/activeadmin

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
3.2.2

Affected versions

0.*

0.1.0
0.1.1
0.2.0
0.2.1
0.2.2
0.3.0
0.3.1
0.3.2
0.3.3
0.3.4
0.4.0
0.4.1
0.4.2
0.4.3
0.4.4
0.5.0.pre
0.5.0.pre1
0.5.0
0.5.1
0.6.0
0.6.1
0.6.2
0.6.3
0.6.4
0.6.5
0.6.6

1.*

1.0.0.pre1
1.0.0.pre2
1.0.0.pre3
1.0.0.pre4
1.0.0.pre5
1.0.0
1.1.0
1.2.0
1.2.1
1.3.0
1.3.1
1.4.0
1.4.1
1.4.2
1.4.3

2.*

2.0.0.rc1
2.0.0.rc2
2.0.0
2.1.0
2.2.0
2.3.0
2.3.1
2.4.0
2.5.0
2.6.0
2.6.1
2.7.0
2.8.0
2.8.1
2.9.0
2.10.0
2.10.1
2.11.0
2.11.1
2.11.2
2.12.0
2.13.0
2.13.1
2.14.0

3.*

3.0.0
3.1.0
3.2.0
3.2.1

RubyGems / activeadmin

Package

Name
activeadmin
Purl
pkg:gem/activeadmin

Affected ranges

Type
ECOSYSTEM
Events
Introduced
4.0.0.beta1
Fixed
4.0.0.beta7

Affected versions

4.*

4.0.0.beta1
4.0.0.beta2
4.0.0.beta3
4.0.0.beta4
4.0.0.beta5
4.0.0.beta6