Skip to content
XSS Disclosed report Intermediate CVE-2023-23913

[CVE-2023-23913] DOM Based Cross-site Scripting in rails-ujs for contenteditable HTML Elements

A DOM-based cross-site scripting flaw in rails-ujs allows malicious HTML pasted into a contenteditable element to execute JavaScript. An attacker could achieve arbitrary JavaScript execution on the affected origin if they can get a victim to paste crafted clipboard content.

ryotak Follow

Originally disclosed on HackerOne

  • Triaged in 33 hours
  • Fixed in 11 days
  • Paid in 11 days
  • Disclosed after 11 days

Summary by the program

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.

This vulnerability has been assigned the CVE identifier CVE-2023-23913.

Versions Affected: >= 5.1.0 Not affected: < 5.1.0 Fixed Versions: 6.1.7.3, 7.0.4.3

Impact If the specified malicious HTML clipboard content is provided to a contenteditable element, this could result in the arbitrary execution of javascript on the origin in question.

The report

Summary

Original report: https://hackerone.com/reports/1767802

Impact

If the specified malicious HTML clipboard content is provided to a contenteditable element, this could result in the arbitrary execution of javascript on the origin in question.

The original report as published on HackerOne, by ryotak. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, rails-ujs does not properly sanitise HTML pasted into contenteditable elements, allowing attributes like data-method to trigger JavaScript execution.

Impact

An attacker could execute arbitrary JavaScript on the affected origin if malicious clipboard content is pasted into a contenteditable element.

What the attacker needed

Victim pastes malicious HTML into contenteditable; rails-ujs version >= 5.1.0

The fix

It was fixed in versions [redacted] and 7.0.4.3.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

This is a cross-site scripting (XSS) bug where a web page can run harmful JavaScript if someone pastes specially crafted HTML into an editable area. The problem is that the page's own JavaScript library (rails-ujs) trusts pasted content too much and executes it.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by ryotak

View all

23 more disclosed reports, best first.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.