← All advisories

CVE-2026-140424highData leakage2026-12-01

CVE-2026-140424: Markdownify MCP server's MD_ALLOWED_PATHS / MD_SHARE_DIR allowlist could be escaped via sibling folders with the same prefix, symlinks and ~ paths, so agents could read files outside it (fixed 1.2.0)

In mcp-markdownify-server 1.1.0 and earlier, the path allowlist that operators set with MD_ALLOWED_PATHS or MD_SHARE_DIR had three holes. A plain startsWith() check let /srv/share-evil pass for /srv/share, symlinks inside an allowed folder were not resolved, and Markdownify.get() checked the ~-expanded path but read the raw one. A client calling the local-file conversion tools, directly or through prompt injection, could read files outside the allowlist. Fixed in 1.2.0.

01.

What it is

isWithinDirectory() in src/utils.ts used normPath.startsWith(normDir) with no directory-separator boundary, so sibling directories sharing a prefix counted as allowed.

assertPathAllowed() validated the lexical path without fs.realpathSync(), so a symlink inside an allowed directory could point anywhere.

Markdownify.get() validated the expanded resolvedPath but then called fs.existsSync() and readFile() on the unexpanded filePath.

Fixed in v1.2.0 (PR #104) with path.relative() boundary checks, realpath canonicalization of both requested paths and allowed roots, and resolvedPath used for every filesystem call. The advisory GHSA-wp59-q6fv-34rx was published on 25 November 2026; NVD published CVE-2026-140424 on 1 December 2026.

02.

How to check

  1. Run npm ls mcp-markdownify-server (or check your MCP client config) and confirm the version is 1.2.0 or later.
  2. If you rely on MD_ALLOWED_PATHS / MD_SHARE_DIR, check for sibling folders with the same prefix and for symlinks inside the allowed folders.
03.

How to fix

  1. Upgrade mcp-markdownify-server to 1.2.0 or later (this also fixes the SSRF bypass CVE-2026-137308).
  2. Until then, run it in a container or as a user that can only see the files it should convert.
npm ls mcp-markdownify-server
npm ls -g mcp-markdownify-server
04.

Sources

Related on VibeVulns
The weekly email

One email a week. Only what changed.

Every new security hole in AI coding tools, MCP servers, app builders and the stacks they generate (Next.js, Supabase, Node, PHP), each with how to check your app and the fix. No roundups of things you already read.

Free, one email a week. Read the latest issue first if you like. One-click unsubscribe in every email. We never sell or share addresses.