CVE-2023-23913 in actionview Geminfo

Summary

by MITRE • 01/09/2025

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.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 04/25/2025

The vulnerability identified as CVE-2023-23913 represents a significant security risk within the rails-ujs library, which is a core component of ruby on rails web applications. This issue stems from a DOM-based cross-site scripting vulnerability that specifically targets the Clipboard API functionality. The flaw occurs when applications utilizing rails-ujs process HTML content that has been pasted from the clipboard and contains specific data attributes. The vulnerability is particularly concerning because it leverages legitimate browser APIs while exploiting the trust placed in user-generated content, making it difficult to detect and prevent through traditional security measures.

The technical exploitation of this vulnerability occurs through the manipulation of HTML elements that possess the contenteditable attribute. When malicious content is pasted into such elements, the Clipboard API can inadvertently process HTML fragments that contain data-method, data-remote, or data-disable-with attributes. These attributes are typically used by rails-ujs to enhance application functionality by enabling features like remote form submissions and method overrides. However, when these attributes are embedded within malicious HTML content from clipboard operations, they create opportunities for attackers to inject arbitrary JavaScript code that executes within the victim's browser context. This represents a classic DOM-based XSS vulnerability where the attack vector originates from user input processed through browser APIs rather than server-side request parameters.

The operational impact of this vulnerability extends beyond simple script execution, as it can enable attackers to perform a wide range of malicious activities within the context of authenticated users. The vulnerability specifically affects applications that implement the rails-ujs library and have HTML elements with contenteditable attributes, which are common in rich text editors, comment systems, and content management interfaces. Attackers could potentially leverage this vulnerability to steal session cookies, perform unauthorized actions on behalf of users, redirect users to malicious sites, or exfiltrate sensitive data from the application. The risk is particularly elevated in applications where users can paste content from external sources, as the attack surface expands to include any clipboard-based content manipulation features.

The security implications of this vulnerability align with CWE-79, which specifically addresses cross-site scripting flaws in web applications, and can be mapped to ATT&CK technique T1566.001 for credential access through spearphishing attachments. Organizations utilizing ruby on rails applications that incorporate clipboard functionality or contenteditable elements must urgently address this vulnerability through immediate patching of affected rails-ujs versions. The recommended mitigation strategy involves updating to patched versions of the rails-ujs library, implementing proper HTML sanitization of clipboard content, and potentially disabling or restricting the use of contenteditable attributes in contexts where clipboard operations occur. Additionally, organizations should consider implementing Content Security Policy headers to limit the execution of inline scripts and establish monitoring for suspicious clipboard-related activities within their applications. The vulnerability demonstrates the importance of securing browser APIs and user input processing mechanisms, particularly in modern web applications that rely heavily on rich user interactions and dynamic content manipulation features.

Reservation

01/19/2023

Disclosure

01/09/2025

Moderation

accepted

CPE

ready

EPSS

0.00632

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!