| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| prosemirror_to_html | rubygems | < 0.2.1 | 0.2.1 |
The vulnerability is a Cross-Site Scripting (XSS) issue within the prosemirror_to_html gem. The root cause is the failure to escape HTML attribute values during the conversion of a ProseMirror document to HTML. The analysis of the patch in commit 4d59f94f550bcabeec30d298791bbdd883298ad8 reveals that the ProsemirrorToHtml::Renderer.render_opening_tag function was directly concatenating raw attribute values from the input JSON into the generated HTML. This allows an attacker to craft a malicious ProseMirror document with payloads like javascript:alert('XSS') in href attributes or onerror handlers on images. When the ProsemirrorToHtml::Renderer.render method is called with this malicious document, it triggers the vulnerable render_opening_tag function, which then produces an HTML output containing executable JavaScript. The patch rectifies this by properly escaping all attribute values using CGI.escapeHTML, preventing the injection and execution of arbitrary scripts.
ProsemirrorToHtml::Renderer.render_opening_taglib/prosemirror_to_html.rb
ProsemirrorToHtml::Renderer.renderlib/prosemirror_to_html.rb
Ongoing coverage of React2Shell