md-editor-v3 is vulnerable to Cross-Site Scripting (XSS)
61
Medium Risk
The Markdown preview renderer in MdPreview interpolates a fenced code block's language info string into HTML attributes without escaping it. A crafted info string on a code fence breaks out of the attribute and injects arbitrary markup, so JavaScript executes in the page origin when the preview is rendered. The bundled XSSPlugin does not stop this because it only inspects pre-existing HTML tokens and never sees the markup produced by the highlight callback, so hosted Markdown becomes stored cross-site scripting. The fix escapes the language value with escapeHtml and quotes the attribute before interpolation.
You are affected if your application uses MdPreview (or the MdEditor preview) to render Markdown that comes from untrusted or externally influenced sources on any release up to and including 6.5.3. Enabling the bundled XSSPlugin does not protect you, because the malicious markup is emitted by the fenced-code highlight renderer and never passes through the sanitized HTML tokens the plugin inspects. Applications that only render fully trusted, first-party Markdown are not at practical risk.
md-editor-v3 is vulnerable to Cross-Site Scripting (XSS) in versions 0.0.1 - 6.5.3.
Upgrade the md-editor-v3 library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant