Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS05bWc2LXg0NXYtaGNmbc4AA8mX

activeadmin vulnerable to stored persistent cross-site scripting (XSS) in dynamic form legends

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:

  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

Permalink: https://github.com/advisories/GHSA-9mg6-x45v-hcfm
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS05bWc2LXg0NXYtaGNmbc4AA8mX
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: 8 months ago
Updated: 3 months ago


CVSS Score: 7.2
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N

Identifiers: GHSA-9mg6-x45v-hcfm, CVE-2024-37031
References: Repository: https://github.com/activeadmin/activeadmin
Blast Radius: 30.4

Affected Packages

rubygems:activeadmin
Dependent packages: 192
Dependent repositories: 16,473
Downloads: 37,045,555 total
Affected Version Ranges: >= 4.0.0.beta1, < 4.0.0.beta7, < 3.2.2
Fixed in: 4.0.0.beta7, 3.2.2
All affected versions: 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, 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.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.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.0.0, 3.1.0, 3.2.0, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.5
All unaffected versions: