CVE-2023-23913 rails-ujs vulnerable to DOM Based Cross-site Scripting contenteditable HTML Elements

Medium 6.3 Published Updated

Attackers can execute arbitrary JavaScript via DOM-based XSS when users paste malicious HTML into contenteditable elements using rails-ujs.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2023-23913?

CVE-2023-23913 is a medium-severity cross-site scripting vulnerability in rails-ujs, published on 9 Jan 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

There is a potential DOM based cross-site scripting issue in rails-ujs which leverages the Clipboard API to target HTML elements that are assigned the contenteditable attribute. This has the potential to occur when pasting malicious HTML content from the clipboard that includes a data-method, data-remote or data-disable-with attribute.

Weakness: CWE-79

Which versions are affected by CVE-2023-23913?

4 open source packages ship an affected version, including actionview.

PackageAffectedFixed in
actionview RubyGemsFrom 5.1.06.1.7.3
actionview RubyGemsFrom 5.1.06.1.7.3
actionview RubyGemsFrom 7.0.07.0.4.3
actionview RubyGemsFrom 7.0.07.0.4.3
Linux distribution packages (7)
rubygem-actionview-5_1 SUSE:Linux Enterprise High Availability Extension 15 SP1All versions5.1.4-150000.3.9.1
rubygem-actionview-5_1 SUSE:Linux Enterprise High Availability Extension 15 SP2All versions5.1.4-150000.3.9.1
rubygem-actionview-5_1 SUSE:Linux Enterprise High Availability Extension 15 SP3All versions5.1.4-150000.3.9.1
rubygem-actionview-5_1 SUSE:Linux Enterprise High Availability Extension 15 SP4All versions5.1.4-150000.3.9.1
rubygem-actionview-5_1 SUSE:Linux Enterprise High Availability Extension 15 SP5All versions5.1.4-150000.3.9.1
rubygem-actionview-5_1 openSUSE:Leap 15.4All versions5.1.4-150000.3.9.1
rubygem-actionview-5_1 openSUSE:Leap 15.5All versions5.1.4-150000.3.9.1

How do I fix CVE-2023-23913?

Upgrade actionview to a fixed version for your release line: 6.1.7.3 or 7.0.4.3.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2023-23913 being exploited?

There is no known exploitation of CVE-2023-23913 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2023-23913, GHSA-xp5h-f8jf-rc8q, OESA-2024-1774, OESA-2024-1775, OESA-2024-1776, SUSE-SU-2023:3813-1 and 1 more.

Is CVE-2023-23913 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free