GHSA-9MG6-X45V-HCFM
Vulnerability from github – Published: 2024-06-02 22:32 – Updated: 2024-10-28 12:37Impact
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
namevalue dependent on an attribute of theresource):
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
{
"affected": [
{
"package": {
"ecosystem": "RubyGems",
"name": "activeadmin"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.2.2"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "RubyGems",
"name": "activeadmin"
},
"ranges": [
{
"events": [
{
"introduced": "4.0.0.beta1"
},
{
"fixed": "4.0.0.beta7"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-37031"
],
"database_specific": {
"cwe_ids": [
"CWE-79"
],
"github_reviewed": true,
"github_reviewed_at": "2024-06-02T22:32:24Z",
"nvd_published_at": "2024-06-03T06:15:10Z",
"severity": "HIGH"
},
"details": "### Impact\n\nUsers 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.\n\nFor example:\n\n* A public web application allows users to create entities with arbitrary names.\n* Active Admin is used to administrate these entities through a private backend.\n* 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`):\n\n```ruby\n form do |f|\n f.inputs name: resource.name do\n f.input :name\n f.input :description\n end\n\n f.actions\n end\n```\n\nThen a malicious user could create an entity with a payload that would get executed in the active admin administrator\u0027s browser.\n\nBoth `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.\n\n### Patches\n\nThe problem has been fixed in ActiveAdmin 3.2.2 and ActiveAdmin 4.0.0.beta7.\n\n### Workarounds\n\nUsers can workaround this problem without upgrading by explicitly escaping the form name using an HTML escaping utility. For example:\n\n```ruby\n form do |f|\n f.inputs name: ERB::Util.html_escape(resource.name) do\n f.input :name\n f.input :description\n end\n\n f.actions\n end\n```\nUpgrading is of course recommended though.\n\n### References\nhttps://owasp.org/www-community/attacks/xss/#stored-xss-attacks",
"id": "GHSA-9mg6-x45v-hcfm",
"modified": "2024-10-28T12:37:00Z",
"published": "2024-06-02T22:32:24Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/activeadmin/activeadmin/security/advisories/GHSA-9mg6-x45v-hcfm"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-37031"
},
{
"type": "WEB",
"url": "https://github.com/activeadmin/activeadmin/pull/8349"
},
{
"type": "PACKAGE",
"url": "https://github.com/activeadmin/activeadmin"
},
{
"type": "WEB",
"url": "https://github.com/activeadmin/activeadmin/releases/tag/v3.2.2"
},
{
"type": "WEB",
"url": "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/activeadmin/CVE-2024-37031.yml"
},
{
"type": "WEB",
"url": "https://rubygems.org/gems/activeadmin/versions/3.2.2"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "activeadmin vulnerable to stored persistent cross-site scripting (XSS) in dynamic form legends"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.