microsoft / microsoft/markitdown

Local File Read via Unsafe File Path Resolution in convert_to_markdown Tool

Open
#1,905 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
186k
Forks
13.7k
Avg merge
1d 4h
Merged PRs (30d)
49

Description

The convert_to_markdown tool appears to process file:// URIs without sufficient access control. When given the input file:///etc/passwd, the service returned content consistent with the deployment server's local /etc/passwd file.

This behavior suggests that the tool may resolve user-supplied file URIs and expose server-side local file-system content during document conversion. The issue was observed over stdio transport and may indicate insufficient validation of URI schemes, file paths, or accessible conversion sources.

We recommend restricting the input sources that the tool can convert. The tool should reject untrusted local file:// URIs, unless local file conversion is an intended feature and access is limited to a safe, allowlisted directory. If local file conversion is required, access should be limited to a dedicated allowlisted working directory, with path canonicalization and boundary checks applied before opening any file.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the convert_to_markdown entry point and trace how file:// URIs are accepted during stdio conversion. Reproduce the reported /etc/passwd case in the existing test setup, then verify that untrusted local paths are rejected or constrained to a canonicalized allowlisted directory. Done means server-side files outside the permitted source area cannot be read.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
security, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.