Skip to main content

CVE-2024-7739: Yzane Markdown PDF XSS Vulnerability

CVE-2024-7739 is a cross-site scripting flaw in Yzane vscode-markdown-pdf that allows remote attackers to execute malicious scripts. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-7739 Overview

CVE-2024-7739 is a cross-site scripting (XSS) vulnerability in the yzane vscode-markdown-pdf extension version 1.5.0 for Visual Studio Code. The extension converts Markdown files into PDF, HTML, PNG, and JPEG outputs. Attackers can inject script content that executes when a crafted Markdown document is processed by the extension. The issue is classified under [CWE-79] and can be triggered remotely without authentication. Public disclosure of the exploit means opportunistic exploitation is feasible against developers who install untrusted Markdown files.

Critical Impact

A remote attacker can execute arbitrary script content in the context of the rendered document by delivering a crafted Markdown file to a user of the markdown-pdf extension.

Affected Products

  • yzane markdown-pdf (vscode-markdown-pdf) version 1.5.0
  • Visual Studio Code environments with the affected extension installed
  • Downstream artifacts (HTML/PDF) generated from attacker-controlled Markdown

Discovery Timeline

  • 2024-08-13 - CVE-2024-7739 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-7739

Vulnerability Analysis

The markdown-pdf extension renders Markdown to HTML before converting to the target output format. The extension does not adequately sanitize embedded script content or HTML tags supplied in the source Markdown. When a user opens or converts a crafted Markdown file, the injected payload is preserved in the rendered HTML context and executes during preview or export.

Because conversion runs inside a developer workstation, execution of attacker-controlled JavaScript in the rendered context may exfiltrate content from the document, interact with the local rendering surface, or persist malicious script into generated HTML artifacts shared with other users. Integrity of the generated documents is directly impacted.

Root Cause

The root cause is improper neutralization of input during web page generation, classified as [CWE-79]. The extension trusts Markdown content and does not strip or encode embedded <script> tags and event-handler attributes before rendering.

Attack Vector

Exploitation requires a target user to process a malicious Markdown file with the vulnerable extension. Attackers deliver the crafted .md file through phishing, shared repositories, pull requests, or documentation contributions. No authentication or privileged access to the victim system is required, and no user interaction beyond opening or converting the file is needed.

The vulnerability manifests during the Markdown-to-HTML rendering stage of the extension. See the public GitHub Script Injection Report and the accompanying GitHub POC Video for a demonstration.

Detection Methods for CVE-2024-7739

Indicators of Compromise

  • Markdown files containing <script> tags, inline event handlers (onerror, onload, onclick), or javascript: URIs delivered through untrusted channels.
  • Generated HTML/PDF artifacts produced by markdown-pdf that contain unexpected script blocks or external resource references.
  • VS Code extension logs showing conversion of Markdown documents originating from external contributors or untrusted repositories.

Detection Strategies

  • Inventory workstations for installed VS Code extensions and flag installations of yzane.markdown-pdf at version 1.5.0.
  • Scan Markdown source files in shared repositories for embedded HTML script tags and event-handler attributes prior to conversion.
  • Inspect rendered HTML outputs for unexpected inline JavaScript before distribution.

Monitoring Recommendations

  • Monitor developer endpoints for outbound network requests originating from Chromium/Electron rendering processes invoked by the extension.
  • Alert on new or modified HTML/PDF outputs in shared documentation pipelines that contain script content.
  • Track VS Code extension version changes through endpoint management or software inventory tooling.

How to Mitigate CVE-2024-7739

Immediate Actions Required

  • Identify all installations of yzane.markdown-pdf version 1.5.0 and disable or uninstall the extension where a fixed release is not available.
  • Restrict use of the extension to trusted Markdown content and prohibit conversion of files received from external contributors.
  • Review previously generated HTML and PDF artifacts derived from untrusted Markdown for injected script content.

Patch Information

At the time of the last NVD update on 2026-06-17, no vendor advisory URL is listed for CVE-2024-7739. Consult the VulDB entry #274359 and the extension's public repository for the latest release information before upgrading.

Workarounds

  • Sanitize Markdown source files by stripping HTML tags and event-handler attributes prior to conversion.
  • Use an alternative Markdown-to-PDF pipeline that enforces HTML sanitization for untrusted content.
  • Perform conversions in an isolated environment, such as a container or ephemeral VM, to limit the blast radius of executed script content.
bash
# Identify and remove the affected VS Code extension on developer workstations
code --list-extensions --show-versions | grep -i 'yzane.markdown-pdf'
code --uninstall-extension yzane.markdown-pdf

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.