GitHub Advisoryadvisory · RubyGems
GHSA-8qgm-g2vv-vwvc RailsAdmin Cross-site Scripting vulnerability in the list view
MEDIUM
Official page ↗
- Aliases
- CVE-2024-39308
- Ecosystem
- RubyGems
- Packages
- rails_admin
- Severity
- Moderate
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N
- Weaknesses
- CWE-79
- Reviewed
- 2024-07-08
Affected packages
• RubyGems rails_admin: >= 3.0.0.beta, < 3.1.3 → fixed in 3.1.3
Description
Impact
RailsAdmin list view has the XSS vulnerability, caused by improperly-escaped HTML title attribute.
The issue was originally reported in https://github.com/railsadminteam/rails_admin/issues/3686.
Patches
Upgrade to 3.1.4. The vulnerability itself was patched in 3.1.3 but it has a functionality issue.
Initially the vulnerability was thought to exist in versions before 3.0, but it didn't. 2.x users can stay on 2.2.1.
Workarounds
1. Copy the index view (located under the path `app/views/rails_admin/main/index.html.erb`) from the RailsAdmin version you use, and place it into your application by using the same path.
2. Open the view file by an editor, and change the way to populate the td tag:
```diff
• " title="">
+
•
+
```
Note: The view file created by this needs to be removed after upgrading RailsAdmin afterwards, unless this old view continue to be used. Only do this if you can't upgrade RailsAdmin now for a reason.
References
https://owasp.org/www-community/attacks/xss/
https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-strip_tags
Related
Alias · CVE (1)
- CVE-2024-39308 RailsAdmin is a Rails engine that provides an interface for managing data. vulnerability
Weakness · CWE (1)
- CWE-79 Improper Neutralization of Input During Web Page Generation weakness
References
- https://github.com/railsadminteam/rails_admin/security/advisories/GHSA-8qgm-g2vv-vwvc web
- https://nvd.nist.gov/vuln/detail/CVE-2024-39308 advisory
- https://github.com/railsadminteam/rails_admin/issues/3686 web
- https://github.com/railsadminteam/rails_admin/commit/b5a287d82e2cbd1737a1a01e11ede2911cce7fef web
- https://github.com/railsadminteam/rails_admin/commit/d84b39884059c4ed50197cec8522cca029a17673 web
- https://github.com/railsadminteam/rails_admin package
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails_admin/CVE-2024-39308.yml web
- https://rubygems.org/gems/rails_admin/versions/2.3.0 web
- https://rubygems.org/gems/rails_admin/versions/3.1.3 web