CVE-2026-140424: markdownify-mcp before 1.2.0 Path Allowlist Bypass via isWithinDirectory Prefix Match

Published Dec 1, 2026
·
Updated

markdownify-mcp before 1.2.0 contains a path traversal vulnerability in isWithinDirectory() that allows attackers to bypass MDALLOWEDPATHS and MDSHAREDIR restrictions. Attackers invoking local-file conversion tools directly or via prompt injection can target sibling directories sharing an allowed prefix to read files outside the allowlist.

Affected Software

1 affected component
npm/markdownify-mcp<1.2.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade markdownify-mcp to a version that resolves this vulnerability.

    Fixed in 1.2.0

Event History

Dec 1, 2026
CVE Published
via OSV·03:43 PM
Data Sourced
via OSV·03:43 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:18 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed?

Deployments of npm/markdownify-mcp before version 1.2.0 are affected when they rely on MD_ALLOWED_PATHS or MD_SHARE_DIR to restrict local-file conversion access. Sibling directories whose names share a prefix with an allowed directory can be targeted.

2

What access does an attacker need to exploit this?

An attacker needs a way to invoke the local-file conversion tools. This may be through direct tool invocation or through prompt injection that causes the tools to access an attacker-chosen path.

3

What is the practical impact of a successful bypass?

The bypass can allow reading files outside the configured allowlist or share-directory restriction. The affected restriction is path-based, so files in sibling directories sharing the allowed prefix may be exposed.

4

How can I determine whether an instance is affected?

Check whether markdownify-mcp is earlier than 1.2.0 and whether MD_ALLOWED_PATHS or MD_SHARE_DIR is configured. Review allowed paths for similarly named sibling directories, since the vulnerable isWithinDirectory() check uses prefix matching.

5

What should be done if an upgrade cannot be applied immediately?

Restrict who and what can invoke local-file conversion tools, including limiting prompt-injection paths to tool use. Avoid configuring allowed directories alongside sensitive sibling directories with matching path prefixes until version 1.2.0 can be deployed.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203