|
| 1 | +--- |
| 2 | +layout: advisory |
| 3 | +title: 'CVE-2024-39308 (rails_admin): RailsAdmin Cross-site Scripting vulnerability |
| 4 | + in the list view' |
| 5 | +comments: false |
| 6 | +categories: |
| 7 | +- rails_admin |
| 8 | +advisory: |
| 9 | + gem: rails_admin |
| 10 | + cve: 2024-39308 |
| 11 | + ghsa: 8qgm-g2vv-vwvc |
| 12 | + url: https://github.com/railsadminteam/rails_admin/security/advisories/GHSA-8qgm-g2vv-vwvc |
| 13 | + title: RailsAdmin Cross-site Scripting vulnerability in the list view |
| 14 | + date: 2024-07-08 |
| 15 | + description: | |
| 16 | + ### Impact |
| 17 | + RailsAdmin list view has the XSS vulnerability, caused by |
| 18 | + improperly-escaped HTML title attribute. The issue was originally |
| 19 | + reported in https://github.com/railsadminteam/rails_admin/issues/3686. |
| 20 | +
|
| 21 | + ### Patches |
| 22 | + Upgrade to [3.1.3](https://rubygems.org/gems/rails_admin/versions/3.1.3) |
| 23 | + or [2.3.0](https://rubygems.org/gems/rails_admin/versions/2.3.0). |
| 24 | +
|
| 25 | + ### Workarounds |
| 26 | + 1. Copy the index view (located under the path |
| 27 | + `app/views/rails_admin/main/index.html.erb`) from the RailsAdmin |
| 28 | + version you use, and place it into your application by using |
| 29 | + the same path. |
| 30 | +
|
| 31 | + 2. Open the view file by an editor, and remove `strip_tags` from |
| 32 | + the title attribute (as shown in GHSA advisory below). |
| 33 | +
|
| 34 | + **Note:** The view file created by this needs to be removed after |
| 35 | + upgrading RailsAdmin afterwards, unless this old view continue to |
| 36 | + be used. Only do this if you can't upgrade RailsAdmin now for a reason. |
| 37 | +
|
| 38 | + ### References |
| 39 | + https://owasp.org/www-community/attacks/xss/ |
| 40 | + https://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-strip_tags |
| 41 | + cvss_v3: 6.8 |
| 42 | + patched_versions: |
| 43 | + - "~> 2.3.0" |
| 44 | + - ">= 3.1.3" |
| 45 | + related: |
| 46 | + url: |
| 47 | + - https://nvd.nist.gov/vuln/detail/CVE-2024-39308 |
| 48 | + - https://github.com/railsadminteam/rails_admin/security/advisories/GHSA-8qgm-g2vv-vwvc |
| 49 | + - https://github.com/railsadminteam/rails_admin/issues/3686 |
| 50 | + - https://github.com/railsadminteam/rails_admin/commit/b5a287d82e2cbd1737a1a01e11ede2911cce7fef |
| 51 | + - https://github.com/railsadminteam/rails_admin/commit/d84b39884059c4ed50197cec8522cca029a17673 |
| 52 | + - https://rubygems.org/gems/rails_admin/versions/2.3.0 |
| 53 | + - https://rubygems.org/gems/rails_admin/versions/3.1.3 |
| 54 | + - https://github.com/advisories/GHSA-8qgm-g2vv-vwvc |
| 55 | +--- |
0 commit comments