Executive brief
Markdownify MCP Server is a tool used to convert various file formats and web content into Markdown text for use with AI models. A security flaw allows an attacker to trick the server into reading sensitive files from the host computer, such as system configuration or password files. This could lead to the exposure of private data if an AI agent or user interacts with a malicious prompt or website.
Technical details
The mcp-markdownify-server package is vulnerable to an arbitrary file read vulnerability (CWE-552) within its 'get-markdown-file' tool. The root cause is a lack of path validation or extension filtering in the 'get' method of the Markdownify class, which directly reads a file from a provided 'filePath' argument. An attacker can exploit this by crafting a malicious prompt or web page that, when processed by an MCP-enabled AI host, triggers the tool to access sensitive system files (e.g., /etc/passwd). While the attack is delivered over the network, it requires user interaction (the user or their AI agent must access the malicious content). The vulnerability is fixed in version 1.0.0 by implementing file extension validation.
Affected products
- zcaceres mcp-markdownify-server < 1.0.0
Timeline
- 2025-05-28: disclosed: Vulnerability disclosed by Snyk research team.
- 2025-05-29: advisory: GitHub Advisory GHSA-22v8-p7h2-rj7p published.
- 2025-05-29: patched: Fix committed in version 1.0.0.
References
- https://github.com/zcaceres/markdownify-mcp/commit/3a6b202d088ef7acb8be84bc09515f41a2b1a9df
- https://github.com/zcaceres/markdownify-mcp
- https://github.com/zcaceres/markdownify-mcp/blob/3667bd4765c0e49684ce22df268d02dd478a7f3b/src/Markdownify.ts
- https://security.snyk.io/vuln/SNYK-JS-MCPMARKDOWNIFYSERVER-10249193