markdownify-mcp
- Type
- MCP server
- Scanned
- Nov 12, 2026
- Version
- 024f97cea9a9
- Files read
- 25
This MCP server converts local documents, images, audio files, web pages, and remote Git repositories into Markdown using the markitdown and repomix command-line tools. Its biggest risk is that untrusted web pages or prompt-injected instructions can make the server read sensitive non-document files on your computer or reach private local network services because URL and file-input checks can be bypassed.
What it can reach
- Files
- Reads local files anywhere on the computer by default (unless MD_ALLOWED_PATHS is set) and writes temporary files in the system temp directory.
- Network
- Fetches HTTP and HTTPS URLs and clones remote Git repositories over the internet.
- Shell commands
- Executes the markitdown Python CLI and the repomix CLI as child processes, and runs a setup script during installation to install Python packages via pip.
Findings
-
HighIncomplete SSRF protection allows access to localhost and internal network services
Before fetching a webpage, validateUrl checks parsed.hostname with the private-ip library, which only matches raw IPv4 and unbracketed IPv6 strings and performs no DNS resolution. Hostnames such as localhost, bracketed IPv6 loopback ([::1]), internal corporate or cloud metadata hostnames, and external domains or HTTP redirects that resolve to private IPs all pass this check and are fetched by the server.
Fix: Strip square brackets from IPv6 hostnames, explicitly block localhost, resolve the hostname via DNS before connecting, verify every resolved IP address against private/loopback/link-local ranges, and connect using a pinned lookup or custom dispatcher so DNS cannot rebind.
-
HighDocument and media tools accept arbitrary secret files, URLs, and CLI flags
Unlike get-markdown-file, the six document and media conversion tools (such as pdf-to-markdown and docx-to-markdown) do not verify the file extension or confirm that filepath points to an existing local file, and they pass filepath directly to the markitdown CLI without a -- separator. If an AI agent is tricked by prompt injection, it can use these tools to read plain-text secrets like .env or SSH keys (when MD_ALLOWED_PATHS is unset), pass internal URLs directly to Python markitdown to bypass validateUrl, or pass CLI flags starting with a dash such as -o to overwrite files.
Fix: Resolve filepath to a local canonical path, verify it is an existing regular file with an allowed extension for the chosen tool, reject inputs starting with - or containing URL schemes, and pass -- before the file path in execFileAsync.
-
MediumGit repository tool allows SCP-style SSH remotes and private network HTTP servers
validateRepoUrl only inspects protocols when the repository string contains ://, and even then it does not check for private or loopback IP addresses. A prompt-injected AI agent can pass an SCP-style Git address (such as git@host:org/repo) to make git connect using the user's ambient SSH keys, or pass an internal HTTP Git server URL on localhost or a private LAN to dump private repository source code.
Fix: Require explicit https:// URLs on an allowlist of public Git hosts (or resolve and block private/loopback IPs just like webpage fetches), reject SCP-style git@ strings, and validate that the branch parameter does not start with - or contain invalid ref characters.
-
LowAllowed-directory restriction can be bypassed via sibling folder prefixes and symlinks
When a user configures MD_ALLOWED_PATHS to restrict file access, isWithinDirectory checks normPath.startsWith(normDir) without requiring a path separator boundary and without resolving symbolic links. If /Users/alice/docs is allowed, paths inside a sibling folder like /Users/alice/docs-private also match the prefix check, and symlinks inside an allowed folder can point to sensitive files anywhere on disk.
Fix: Resolve both the target file and each allowed directory with fs.realpathSync, and check containment using path.relative (or require normPath === normDir || normPath.startsWith(normDir + path.sep)).
-
LowPredictable and uncleaned temporary files in shared temp directory
Fetched web content is written directly into the shared system temp folder using Date.now() in the filename with default file permissions, and temporary files are only deleted if conversion succeeds. Concurrent requests in the same millisecond can collide, other local users on a shared machine may read or race the predictable file path, and failed conversions (such as single-page web apps) leave downloaded files behind on disk.
Fix: Create a private per-request directory with fs.mkdtemp (mode 0700) and move fs.unlinkSync / directory cleanup into a try/finally block so temporary files are always removed.
-
LowUnpinned Python package installation during preinstall
Installing the package runs a preinstall hook that executes pip install with an open-ended >=0.1.5 version range for markitdown[all] and no cryptographic hashes or lockfile. Every fresh install pulls the latest matching Python packages and dozens of optional dependencies from PyPI without reproducible version pinning.
Fix: Pin exact versions and package hashes in a requirements lockfile and pass --require-hashes to pip install.
