What happened
markdownify-mcp before 1.2.0 contains a path traversal vulnerability in isWithinDirectory() that allows attackers to bypass MD_ALLOWED_PATHS and MD_SHARE_DIR restrictions, so local-file conversion tools can target sibling directories sharing an allowed parent. CVSS 7.5.
Why it matters
MCP file-conversion servers are exactly the surface an LLM agent touches; a directory-containment escape means a prompt-injected agent can read files outside the sandbox the operator configured, expanding the blast radius to the developer's broader filesystem.
Attack vector
A path traversal flaw in isWithinDirectory() lets an attacker craft a path that evades the MD_ALLOWED_PATHS and MD_SHARE_DIR containment checks, targeting sibling directories sharing an allowed parent and invoking local-file conversion tools directly or through prompt injection.
Affected systems
markdownify-mcp before 1.2.0
Mitigation
Upgrade markdownify-mcp to 1.2.0 or later, which fixes the directory-containment validation.