Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-46492

CVE-2026-46492: md-fileserver XSS Vulnerability

CVE-2026-46492 is a cross-site scripting flaw in md-fileserver that allows attackers to execute arbitrary JavaScript through unsanitized HTML. This post covers technical details, affected versions, and mitigation.

Published:

CVE-2026-46492 Overview

CVE-2026-46492 is a cross-site scripting (XSS) vulnerability in md-fileserver, a utility that renders local Markdown files in a browser. Versions prior to 1.10.3 process user-supplied Markdown content without sanitizing embedded raw HTML. Attackers can inject <script> tags and other HTML directly into rendered pages, executing arbitrary JavaScript in the context of the affected domain. The maintainer patched the issue in version 1.10.3. The flaw is classified under [CWE-80] (Improper Neutralization of Script-Related HTML Tags in a Web Page).

Critical Impact

An attacker who controls Markdown content rendered by md-fileserver can execute arbitrary JavaScript in the victim's browser, enabling session theft, content tampering, and pivoting to local resources exposed by the file server.

Affected Products

  • md-fileserver versions prior to 1.10.3
  • Deployments serving untrusted or shared Markdown content
  • Environments where Markdown files originate from multiple users

Discovery Timeline

  • 2026-06-09 - CVE-2026-46492 published to NVD
  • 2026-06-09 - Last updated in NVD database

Technical Details for CVE-2026-46492

Vulnerability Analysis

The vulnerability resides in the Markdown rendering pipeline of md-fileserver. When the application converts Markdown source into HTML, it permits raw HTML passthrough, including <script>, <iframe>, and event handler attributes. The rendered output is delivered to the browser without an HTML sanitization step such as DOMPurify or a server-side allowlist filter.

Because the application targets local viewing, developers may treat input as trusted. However, Markdown files frequently arrive from untrusted sources, including shared repositories, cloned wikis, downloaded archives, and collaborative folders. Any such file becomes a script delivery vehicle when opened through md-fileserver.

The payload executes in the origin of the file server itself. That origin typically has access to additional local files indexed by the server, allowing an attacker to exfiltrate Markdown content, read directory listings, or issue requests on behalf of the authenticated user.

Root Cause

The Markdown renderer does not neutralize script-related HTML tags before injecting parsed content into the response. The absence of output encoding or sanitization for embedded HTML is the direct cause, consistent with [CWE-80].

Attack Vector

An attacker crafts a Markdown file containing raw <script> tags or HTML event handlers and delivers it to a victim who opens the file through md-fileserver. The vector is network-reachable because the rendered content executes in any browser pointed at the file server. No authentication is required, and the changed scope reflects script execution affecting resources beyond the originating component.

For technical details, refer to the GitHub Security Advisory GHSA-32q2-hhr5-6qvv and the GitHub Release v1.10.3.

// Code example not provided - see vendor advisory for technical details

Detection Methods for CVE-2026-46492

Indicators of Compromise

  • Markdown files containing <script>, <iframe>, or on*= event handler attributes inside repositories served by md-fileserver
  • Outbound HTTP requests from a browser session to attacker-controlled domains shortly after opening a .md file
  • Unexpected fetches against the md-fileserver origin requesting directory listings or arbitrary file paths

Detection Strategies

  • Scan Markdown corpora for raw HTML tags and inline JavaScript using static analysis or regex-based linters
  • Inspect md-fileserver access logs for sequential requests to .md files followed by anomalous resource fetches
  • Compare installed md-fileserver versions across hosts against the fixed release 1.10.3

Monitoring Recommendations

  • Alert on browser process network connections to unexpected external hosts originating from sessions viewing local Markdown content
  • Track file integrity changes within directories indexed by md-fileserver to identify newly introduced malicious Markdown
  • Monitor for installation or execution of vulnerable md-fileserver versions across developer workstations

How to Mitigate CVE-2026-46492

Immediate Actions Required

  • Upgrade md-fileserver to version 1.10.3 or later on every host running the service
  • Audit Markdown directories served by the application for files containing raw HTML or script tags
  • Restrict access to the md-fileserver listening port using host firewall rules until patching completes

Patch Information

The maintainer fixed the issue in md-fileserver v1.10.3. Update via the package manager used to install the tool, for example npm install -g md-fileserver@1.10.3. Review the GitHub Security Advisory GHSA-32q2-hhr5-6qvv for the full remediation notes.

Workarounds

  • Avoid opening Markdown files from untrusted sources in md-fileserver until the patched version is installed
  • Bind the service to 127.0.0.1 to prevent remote browsers from rendering attacker-supplied Markdown
  • Use a separate Markdown viewer that strips raw HTML when reviewing files of unknown provenance
bash
# Upgrade md-fileserver to the patched release
npm install -g md-fileserver@1.10.3
md-fileserver --version

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

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

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.