rails
cpe:2.3:a:rubyonrails:rails:*:*:*:*:*:*:*, +1 more
- >= 5.1.0, < 6.1.7.3
- >= 5.1.0, < 7.0.4.3
A DOM-based cross-site scripting vulnerability has been identified in the rails-ujs library of Ruby on Rails. This issue affects versions 5.1.0 and higher, prior to 6.1.7.3 and 7.0.4.3. The vulnerability arises when a user pastes malicious HTML into a contenteditable element, targeting attributes such as data-method, data-remote, or data-disable-with. The exploitation leverages the Clipboard API to inject harmful scripts that could be executed in the context of the user's origin.
Exploitation allows for arbitrary JavaScript execution in the context of the affected origin, potentially leading to cross-site scripting consequences.
To reproduce this vulnerability, paste HTML content into a 'contenteditable' element that includes a 'data-method', 'data-remote', or 'data-disable-with' attribute. This can be done by creating a link or button with these attributes and then pasting it into the editable area.
Users are advised to upgrade to Ruby on Rails versions 6.1.7.3 or 7.0.4.3. For those unable to upgrade immediately, a patch is available for the 6.1 series.