VYPR
Medium severity6.5NVD Advisory· Published May 29, 2025· Updated Apr 29, 2026

CVE-2025-5273

CVE-2025-5273

Description

All versions of the package mcp-markdownify-server are vulnerable to Files or Directories Accessible to External Parties via the get-markdown-file tool. An attacker can craft a prompt that, once accessed by the MCP host, will allow it to read arbitrary files from the host running the server.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
mcp-markdownify-servernpm
<= 0.0.1

Patches

1
3a6b202d088e

Merge pull request #16 from supriza/add-get-file-validation

https://github.com/zcaceres/markdownify-mcpZach CaceresMay 7, 2025via ghsa
2 files changed · +28 1
  • README.md+3 1 modified
    @@ -76,7 +76,9 @@ To integrate this server with a desktop app, add the following to your app's ser
     - `docx-to-markdown`: Convert DOCX files to Markdown
     - `xlsx-to-markdown`: Convert XLSX files to Markdown
     - `pptx-to-markdown`: Convert PPTX files to Markdown
    -- `get-markdown-file`: Retrieve an existing Markdown file
    +- `get-markdown-file`: Retrieve an existing Markdown file. File extension must end with: *.md, *.markdown.
    +  
    +  OPTIONAL: set `MD_SHARE_DIR` env var to restrict the directory from which files can be retrieved, e.g. `MD_SHARE_DIR=[SOME_PATH] pnpm run start` 
     
     ## Contributing
     
    
  • src/Markdownify.ts+25 0 modified
    @@ -48,6 +48,17 @@ export class Markdownify {
         return tempOutputPath;
       }
     
    +  private static normalizePath(p: string): string {
    +    return path.normalize(p);
    +  }
    +  
    +  private static expandHome(filepath: string): string {
    +    if (filepath.startsWith('~/') || filepath === '~') {
    +      return path.join(os.homedir(), filepath.slice(1));
    +    }
    +    return filepath;
    +  }
    +
       static async toMarkdown({
         filePath,
         url,
    @@ -96,6 +107,20 @@ export class Markdownify {
       }: {
         filePath: string;
       }): Promise<MarkdownResult> {
    +    // Check file type is *.md or *.markdown
    +    const normPath = this.normalizePath(path.resolve(this.expandHome(filePath)));
    +    const markdownExt = [".md", ".markdown"];
    +    if (!markdownExt.includes(path.extname(normPath))){
    +      throw new Error("Required file is not a Markdown file.");
    +    }
    +
    +    if (process.env?.MD_SHARE_DIR) {
    +      const allowedShareDir = this.normalizePath(path.resolve(this.expandHome(process.env.MD_SHARE_DIR)));
    +      if (!normPath.startsWith(allowedShareDir)) {
    +        throw new Error(`Only files in ${allowedShareDir} are allowed.`);
    +      }
    +    }
    +
         if (!fs.existsSync(filePath)) {
           throw new Error("File does not exist");
         }
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

6

News mentions

0

No linked articles in our index yet.