Skip to content

fix: Bound resource usage and make git transports in MCP server safer#69

Merged
Pringled merged 12 commits intomainfrom
security-issues
May 7, 2026
Merged

fix: Bound resource usage and make git transports in MCP server safer#69
Pringled merged 12 commits intomainfrom
security-issues

Conversation

@Pringled
Copy link
Copy Markdown
Member

@Pringled Pringled commented May 5, 2026

This PR addresses several issues from #59:

  • Reject unsafe git transport schemes (ssh://, file://, SCP-form) in MCP repo argument
  • Cap _IndexCache at 10 entries (LRU) to prevent unbounded memory growth
  • Skip files over 1 MB during indexing to prevent DoS via large files
  • Add 60s timeout to git clone to prevent hung MCP server
  • Fix MCP server instructions that encouraged the LLM to hallucinate GitHub URLs

The first concern (file:// URLs allow arbitrary local-repo read) is not addressed yet, as this changes the functionality of Semble (and arguably makes it worse). This is something for a followup PR.

@Pringled Pringled requested a review from stephantul May 5, 2026 07:59
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/semble/index/create.py 100.00% <100.00%> (ø)
src/semble/index/index.py 100.00% <100.00%> (ø)
src/semble/mcp.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/semble/index/index.py Outdated
Comment thread src/semble/mcp.py Outdated
Comment thread src/semble/mcp.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: MCP server exposes local filesystem and lacks clone safety limits

2 participants