Loading...
Skip to main content

CVE-2024-39308 — Vulnerability in rails_admin — CVE Details

MEDIUM

RailsAdmin Cross-site Scripting vulnerability in the list view

Published July 8, 2024Updated September 10, 2026Source: osv

Summary

### 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](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. 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 <% properties.map{ |property| property.bind(:object, object) }.each do |property| %> <% value = property.pretty_value %> - <td class="<%= [property.sticky? && 'sticky', property.css_class, property.type_css_class].select(&:present?).join(' ') %>" title="<%= value %>"> + <%= content_tag(:td, class: [property.sticky? && 'sticky', property.css_class, property.type_css_class].select(&:present?), title: strip_tags(value.to_s)) do %> <%= value %> - </td> + <% end %> <% end %> ``` **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

Advisory Timeline

  • First published July 8, 2024 (826 days ago).
  • Last revised September 10, 2026 — 794 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Bundler
Update rails_admin to 3.1.3 or later
gem install rails_admin -v 3.1.3

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: rubygems (1).

PackageEcosystemAffectedFixed In
rails_admin
rubygems
3.0.0, 3.0.0.beta, 3.0.0.beta2, 3.0.0.rc (+9 more)3.1.3

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-79
    Cross-site Scripting (XSS)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 6.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
Required
Scope
Changed
Confidentiality
High
Integrity
None
Availability
None

CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:N/A:N

Frequently Asked Questions

What is CVE-2024-39308?
RailsAdmin Cross-site Scripting vulnerability in the list view This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.8/10).
How do I check if my project is affected by CVE-2024-39308?
CVE-2024-39308 affects rails_admin. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2024-39308 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
6.8

Exploitation requires specific conditions or has limited impact. Remediate within weeks.

Also Known As

GHSA-8qgm-g2vv-vwvc

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies