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

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.99%). Schedule for your next planned update.

Does your project use an affected rails_admin version?

Paste your Gemfile.lock to check it for CVE-2024-39308 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my Gemfile.lock

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. 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:
               <% 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 (871 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, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: RubyGems (1).

PackageFixed In
rails_admin RubyGems · Affected: 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. It has a 1.0% probability of exploitation within 30 days (EPSS score). 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 the impact is limited.

EPSS Score (30-day exploit probability)
0.99%
EPSS percentile: 61.3

This is an above-median EPSS score — 61.3% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.

Also Known As

GHSA-8qgm-g2vv-vwvc

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Gemfile.lock