{"id":"CVE-2024-39308","aliases":["GHSA-8qgm-g2vv-vwvc"],"url":"https://o3.security/vulnerability/CVE-2024-39308","summary":"RailsAdmin Cross-site Scripting vulnerability in the list view","details":"### Impact\nRailsAdmin list view has the XSS vulnerability, caused by improperly-escaped HTML title attribute.\nThe issue was originally reported in https://github.com/railsadminteam/rails_admin/issues/3686.\n\n### Patches\nUpgrade to [3.1.4](https://rubygems.org/gems/rails_admin/versions/3.1.4). The vulnerability itself was patched in 3.1.3 but it has a functionality issue.\nInitially the vulnerability was thought to exist in versions before 3.0, but it didn't. 2.x users can stay on 2.2.1.\n\n### Workarounds\n1. 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.\n2. Open the view file by an editor, and change the way to populate the td tag:\n\n```diff\n               <% properties.map{ |property| property.bind(:object, object) }.each do |property| %>\n                 <% value = property.pretty_value %>\n-                <td class=\"<%= [property.sticky? && 'sticky', property.css_class, property.type_css_class].select(&:present?).join(' ') %>\" title=\"<%= value %>\">\n+                <%= content_tag(:td, class: [property.sticky? && 'sticky', property.css_class, property.type_css_class].select(&:present?), title: strip_tags(value.to_s)) do %>\n                   <%= value %>\n-                </td>\n+                <% end %>\n               <% end %>\n```\n\n**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.\n\n### References\nhttps://owasp.org/www-community/attacks/xss/\nhttps://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-strip_tags","published":"2024-07-08T14:33:55.144Z","modified":"2026-08-12T03:51:25.085317668Z","cvss":{"score":6.8,"severity":"MEDIUM","vector":"CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N"},"epss":null,"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"RubyGems","name":"rails_admin","fixedVersion":"3.1.3"}],"fix":{"url":"https://github.com/railsadminteam/rails_admin/commit/b5a287d82e2cbd1737a1a01e11ede2911cce7fef","label":"railsadminteam/rails_admin@b5a287d"},"references":[{"type":"WEB","url":"https://rubygems.org/gems/rails_admin/versions/2.3.0"},{"type":"WEB","url":"https://rubygems.org/gems/rails_admin/versions/3.1.3"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/39xxx/CVE-2024-39308.json"},{"type":"ADVISORY","url":"https://github.com/railsadminteam/rails_admin/security/advisories/GHSA-8qgm-g2vv-vwvc"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-39308"},{"type":"REPORT","url":"https://github.com/railsadminteam/rails_admin/issues/3686"},{"type":"FIX","url":"https://github.com/railsadminteam/rails_admin/commit/b5a287d82e2cbd1737a1a01e11ede2911cce7fef"},{"type":"FIX","url":"https://github.com/railsadminteam/rails_admin/commit/d84b39884059c4ed50197cec8522cca029a17673"},{"type":"PACKAGE","url":"https://github.com/railsadminteam/rails_admin"},{"type":"WEB","url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/rails_admin/CVE-2024-39308.yml"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:25.085317668Z"}}