Skip to content

v0.1.1 — path traversal fix (issue #19)

Latest

Choose a tag to compare

@adhikasp adhikasp released this 10 Nov 00:11

Security release for issue #19 (CWE-22, arbitrary file read via git_read_important_files).

Fixed

  • Path confinement: every file_paths entry is resolved with realpath and must stay inside the clone. Absolute paths, .. segments and symlinks shipped inside a repo (README.md -> ~/.ssh/id_ed25519) are now refused.
  • .git/ refused — config can carry credentials from the clone URL.
  • Size cap: one file at most 512 KiB (MCP_GIT_INGEST_MAX_FILE_BYTES overrides) instead of reading multi-GB files into memory.
  • repo_url validation: https://, ssh:// or scp-style only; file://, ext::, local paths and leading - refused. Optional MCP_GIT_INGEST_ALLOWED_HOSTS allowlist.
  • git_directory_structure no longer recurses into symlinks (a repo could point one at / and stall the server).
  • Dropped the removed FastMCP(dependencies=...) kwarg: the server imports again on current fastmcp (4.x). requires-python is now >=3.10.

Upgrade: uvx --from git+https://github.com/adhikasp/mcp-git-ingest mcp-git-ingest already tracks main; pin @v0.1.1 if you want the tag.

Tests: 32 new pytest cases (uv run --extra test pytest).