markdownify-mcp: three ways past its URL and path checks
markdownify-mcp closed three ways an agent's URL or file request could reach past the server's own guardrails.
· markdownify-mcp · Research by P0LESTAR, tonghuaroot, GeniusKangaroo, leonardosalasd
markdownify-mcp, an MCP server that converts files and web pages to Markdown, fixed three authorization flaws in version 1.2.0: an SSRF filter bypass, a local file path allowlist bypass, and option injection through a git branch name.
01What happened
markdownify-mcp published three security advisories on 25 November 2026 and fixed all of them in version 1.2.0. P0LESTAR, tonghuaroot and GeniusKangaroo reported the server-side request forgery bypass, and leonardosalasd reported the path allowlist bypass and the option injection. The GitHub Advisory Database tracks the SSRF bypass as CVE-2026-137308.
02How it works
The SSRF check passed a parsed hostname to the private-ip package, which classifies only literal IP addresses, so DNS names such as localhost and metadata.google.internal returned nothing and passed. Bracketed IPv6 literals and hex-compressed IPv4-mapped IPv6 addresses were also treated as public. The path check compared strings with a prefix match and never resolved symlinks, so a sibling directory sharing the allowed directory's name prefix stayed readable. A caller-supplied branch value reached repomix as --remote-branch without validation, and repomix runs git fetch with no end-of-options separator, so a value starting with a dash became a git option.
03Who is affected
Operators running mcp-markdownify-server 1.1.0 or earlier are exposed. The path allowlist bypass matters only where MD_ALLOWED_PATHS or MD_SHARE_DIR was set to limit local file reads. The SSRF and option injection paths are reachable through the server's webpage-to-markdown and git-repo-to-markdown tools in any configuration below 1.2.0.
04What to do
Upgrade mcp-markdownify-server to 1.2.0. Treat any URL or branch value handled by an older server as attacker-influenced, and review whether the host running it can reach loopback services or a cloud metadata endpoint.
Questions people ask
- Which version of mcp-markdownify-server fixes the SSRF bypass?
- Version 1.2.0 of mcp-markdownify-server fixes all three reported flaws. The release drops the private-ip dependency in favour of Node's built-in node:net BlockList, adds fail-closed asynchronous DNS resolution, and re-checks the hostname on every redirect. Every release up to and including 1.1.0 is listed as affected, so operators below 1.2.0 should upgrade.
- Am I affected if I never set MD_ALLOWED_PATHS?
- Operators who never set MD_ALLOWED_PATHS or MD_SHARE_DIR escape the path allowlist bypass, which applies only where those variables limit local file reads. The server-side request forgery bypass and the git branch option injection do not depend on that configuration, so an unconfigured markdownify-mcp server below version 1.2.0 stays exposed to both of them.
- How would an attacker reach the SSRF bypass in markdownify-mcp?
- The advisory record for CVE-2026-137308 states that an attacker can influence the URLs passed to the webpage-to-markdown and git-repo-to-markdown tools through prompt injection. Content the agent reads supplies a hostname that resolves to loopback, a private range or a cloud metadata endpoint, and the server fetched it because the old filter classified only literal IP addresses.
- What did the branch parameter option injection allow?
- markdownify-mcp passed a caller-supplied branch value straight to repomix as --remote-branch with no validation, and repomix runs git fetch without an end-of-options separator. A branch value beginning with a dash was therefore read as a git command-line option. Version 1.2.0 adds validateBranchName(), which rejects values starting with a dash or containing .., @{, .lock or whitespace.
Sources 5 links, all fetched
- 1github.comSSRF Advisory
- 2github.comPath Allowlist Advisory
- 3github.comBranch Option Advisory
- 4github.comCVE-2026-137308
- 5github.comRelease 1.2.0