Executive brief
editor.md is a popular open-source markdown editor component used in web applications. The vulnerability allows attackers to inject arbitrary JavaScript code through specially crafted markdown text, which is then executed in the browsers of users viewing or editing the content. This can lead to account compromise, session hijacking, or defacement of the application.
Technical details
This is a Cross-site Scripting (CWE-79) vulnerability in editor.md version 1.5.0 and earlier, caused by insufficient sanitization of markdown input before rendering to HTML. An attacker can inject malicious HTML and JavaScript through markdown text—for example, embedding an img tag with an onerror event handler that executes arbitrary code. The vulnerability is triggered when a user edits or views markdown containing the payload, with no authentication required. The attack relies on user interaction (viewing the crafted markdown in the editor) but affects the security context of the application. Patches are available in versions after 1.5.0.
Affected products
- pandao editor.md through 1.5.0
Timeline
- 2023-03-21: disclosed: Issue reported on GitHub
- 2023-05-01: advisory: GitHub Security Advisory GHSA-847g-34c5-vvm8 and CVE-2023-29641 published