{"id":"CVE-2025-64501","aliases":["CVE-2025-64501","GHSA-52c5-vh7f-26fx"],"related":[],"kind":"vulnerability","state":"published","title":"ProsemirrorToHtml: Cross-Site Scripting vulnerability through unescaped HTML attribute values","summary":"ProsemirrorToHtml is a JSON converter which takes ProseMirror-compatible JSON and outputs HTML. In versions 0.2.0 and below, the `prosemirror_to_html` gem is vulnerable to Cross-Site Scripting (XSS) attacks through malicious HTML attribute values. While tag content is properly escaped, attribute values are not, allowing attackers to inject arbitrary JavaScript code. Applications that use `prosemirror_to_html` to convert ProseMirror documents to HTML, user-generated ProseMirror content, and end users viewing the rendered HTML output are all at risk of attack. This issue is fixed in version 0.2.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"ProsemirrorToHtml is a JSON converter which takes ProseMirror-compatible JSON and outputs HTML. In versions 0.2.0 and below, the `prosemirror_to_html` gem is vulnerable to Cross-Site Scripting (XSS) attacks through malicious HTML attribute values. While tag content is properly escaped, attribute values are not, allowing attackers to inject arbitrary JavaScript code. Applications that use `prosemirror_to_html` to convert ProseMirror documents to HTML, user-generated ProseMirror content, and end users viewing the rendered HTML output are all at risk of attack. This issue is fixed in version 0.2.1.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nThe prosemirror_to_html gem is vulnerable to Cross-Site Scripting (XSS) attacks through malicious HTML attribute values. While tag content is properly escaped, attribute values are not, allowing attackers to inject arbitrary JavaScript code.\n\n**Who is impacted:**\n- Any application using prosemirror_to_html to convert ProseMirror documents to HTML\n- Applications that process user-generated ProseMirror content are at highest risk\n- End users viewing the rendered HTML output could have malicious JavaScript executed in their browsers\n\n**Attack vectors include:**\n- `href` attributes with `javascript:` protocol: `<a href=\"javascript:alert(document.cookie)\">`\n- Event handlers: `<div onclick=\"maliciousCode()\">`\n- `onerror` attributes on images: `<img src=x onerror=\"alert('XSS')\">`\n- Other HTML attributes that can execute JavaScript\n\n### Patches\n\nA fix is currently in development. Users should upgrade to version **0.2.1** or later once released.\n\nThe patch escapes all HTML attribute values using `CGI.escapeHTML` to prevent injection attacks.\n\n### Workarounds\n\nUntil a patched version is available, users can implement one or more of these mitigations:\n\n1. **Sanitize output**: Pass the HTML output through a sanitization library like [Sanitize](https://github.com/rgrove/sanitize) or [Loofah](https://github.com/flavorjones/loofah):\n```ruby\n   html = ProsemirrorToHtml.render(document)\n   safe_html = Sanitize.fragment(html, Sanitize::Config::RELAXED)\n```\n\n2. **Implement Content Security Policy (CSP)**: Add strict CSP headers to prevent inline JavaScript execution:\n```\n   Content-Security-Policy: default-src 'self'; script-src 'self'\n```\n\n3. **Input validation**: If possible, validate and sanitize ProseMirror documents before conversion to prevent malicious content from entering the system.\n\n### References\n\n- Vulnerable code: https://github.com/etaminstudio/prosemirror_to_html/blob/ea8beb32f6c37f29f042ba4155ccf18504da716e/lib/prosemirror_to_html.rb#L249\n- [OWASP XSS Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html)\n- [CWE-79: Improper Neutralization of Input During Web Page Generation](https://cwe.mitre.org/data/definitions/79.html)","format":"markdown","source":"ghsa"},{"lang":"es","text":"ProsemirrorToHtml es un conversor JSON que toma JSON compatible con ProseMirror y genera HTML. En las versiones 0.2.0 e inferiores, la gema 'prosemirror_to_html' es vulnerable a ataques de cross-site scripting (XSS) a través de valores de atributos HTML maliciosos. Aunque el contenido de las etiquetas se escapa correctamente, los valores de los atributos no lo están, permitiendo a los atacantes inyectar código JavaScript arbitrario. Las aplicaciones que utilizan 'prosemirror_to_html' para convertir documentos ProseMirror a HTML, el contenido ProseMirror generado por el usuario y los usuarios finales que visualizan la salida HTML renderizada están todos en riesgo de ataque. Este problema está solucionado en la versión 0.2.1.","source":"nvd"}],"published":"2025-11-06T15:44:35.000Z","modified":"2026-10-18T21:10:00.120Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N","score":7.6,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N","score":7.6,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N","score":7.6,"rating":"HIGH"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 0.2.1","status":"affected"}],"vendor":"etaminstudio","product":"prosemirror_to_html","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.2.1"}],"ecosystem":"RubyGems","package":"prosemirror_to_html","purl":"pkg:gem/prosemirror_to_html","source":"ghsa"}],"references":[{"url":"https://github.com/etaminstudio/prosemirror_to_html/security/advisories/GHSA-52c5-vh7f-26fx","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/etaminstudio/prosemirror_to_html/commit/4d59f94f550bcabeec30d298791bbdd883298ad8","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-64501","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/etaminstudio/prosemirror_to_html","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/etaminstudio/prosemirror_to_html/blob/ea8beb32f6c37f29f042ba4155ccf18504da716e/lib/prosemirror_to_html.rb#L249","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/prosemirror_to_html/CVE-2025-64501.yml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/prosemirror_to_html/GHSA-vfpf-xmwh-8m65.yml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-11-12T17:36:18.710Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-64501","url":"https://www.cve.org/CVERecord?id=CVE-2025-64501","licence":"CVE Terms of Use","modified":"2025-11-12T20:14:32.113Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-52c5-vh7f-26fx","url":"https://github.com/advisories/GHSA-52c5-vh7f-26fx","licence":"CC-BY-4.0","modified":"2026-02-03T03:08:25.970Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-64501","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-64501","licence":"Public domain","modified":"2026-10-18T21:10:00.120Z"}],"updatedAt":"2026-11-25T22:59:07.418Z","epss":{"score":0.00242,"percentile":0.16488,"date":"2026-12-01T12:00:22.000Z"}}