# 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.

- **Severity:** High: A working attack on a widely used AI product or ecosystem. A fix may exist. Patch or mitigate this week.
- **Category:** Vulnerability
- **Published by:** markdownify-mcp
- **Disclosed:** 2026-11-25
- **CVE:** CVE-2026-137308
- **CVSS:** 8.3
- **Affects:** mcp-markdownify-server, markdownify-mcp
- **Research by:** P0LESTAR, tonghuaroot, GeniusKangaroo, leonardosalasd
- **Primary source:** https://github.com/zcaceres/markdownify-mcp/security/advisories/GHSA-pxwh-pcrm-vrm3
- **Page:** https://theinjection.dev/items/markdownify-mcp-ssrf-and-path-bypass/

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.

## What 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.

## How 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.

## Who 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.

## What 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.

## Quick facts

- **Affected:** mcp-markdownify-server 1.1.0 and earlier
- **Fixed in:** 1.2.0
- **CVE:** CVE-2026-137308, for the SSRF bypass
- **CVSS:** 8.3, CVSS 4.0
- **Found by:** P0LESTAR, tonghuaroot, GeniusKangaroo, leonardosalasd
- **Disclosed:** 2026-11-25
- **Attack type:** SSRF, path traversal, option injection

## Questions

### 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

1. [SSRF Advisory](https://github.com/zcaceres/markdownify-mcp/security/advisories/GHSA-pxwh-pcrm-vrm3)
2. [Path Allowlist Advisory](https://github.com/zcaceres/markdownify-mcp/security/advisories/GHSA-wp59-q6fv-34rx)
3. [Branch Option Advisory](https://github.com/zcaceres/markdownify-mcp/security/advisories/GHSA-hv2v-j8vq-q59x)
4. [CVE-2026-137308](https://github.com/advisories/GHSA-mqxc-j2ww-xfvx)
5. [Release 1.2.0](https://github.com/zcaceres/markdownify-mcp/releases/tag/v1.2.0)
