RubySec

Providing security resources for the Ruby community

CVE-2024-39308 (rails_admin): RailsAdmin Cross-site Scripting vulnerability in the list view

ADVISORIES

GEM

rails_admin

SEVERITY

CVSS v3.x: 6.8 (Medium)

PATCHED VERSIONS

  • ~> 2.3.0
  • >= 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.3 or 2.3.0.

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 remove strip_tags from the title attribute (as shown in GHSA advisory below).

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