Skip to content

Harden MCP file and Assembly access - #512

Merged
kvz merged 5 commits into
mainfrom
fix/mcp-public-file-inputs
Sep 23, 2026
Merged

kvz merged 5 commits into
mainfrom
fix/mcp-public-file-inputs

Conversation

@tim-kos

@tim-kos tim-kos commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

MCP callers must not inherit the server process’s filesystem or private-network access. Restrict file inputs and authenticated Assembly requests while retaining base64 uploads, public URL inputs, and upload resumption.

  • Remove kind: 'path' from the advertised and runtime file-input schema. Server-side file downloads use the SDK’s existing public-host validation, redirect checks, and pinned DNS.
  • Validate Assembly URLs and IDs before API operations. Resolve their IDs through the configured API endpoint so caller-controlled hosts, redirects, and DNS never receive the authenticated request.
  • Add the SDK’s followRedirects option, preserving its default true, and disable API redirects in MCP. This also prevents redirect_url responses from sending MCP into the local network.
  • Resume public URL uploads without requiring the original instructions. Retain base64 resumption, explicit custom API endpoints, sanitized missing-upload errors, and supported size-limit guidance.

Migration: local filesystem paths are no longer accepted by hosted, self-hosted, or stdio MCP. Use base64, a public URL, or npx -y @transloadit/node upload. Assembly references require a 32-character hexadecimal ID and a Transloadit URL or the configured API origin, without credentials, query parameters, or fragments.

Validation:

  • 53 MCP unit tests pass, including HTTP regressions for path rejection, prepared bytes, resumption, private download rejection, Assembly references, credential routing, and API redirects under bearer and key/secret authentication.
  • New Assembly/URL-resumption regressions failed before the fixes; four additional API-redirect regressions reproduced the redirect exposure.
  • SDK regression verifies that existing callers still follow API redirects by default.
  • corepack yarn check, corepack yarn verify:full, and git diff --check pass. Legacy wrapper documentation was regenerated and staged with the SDK documentation.
  • Council’s empty-redirect finding was reproduced with two failing tests and fixed: redirects without a JSON object now produce a sanitized error.
  • The follow-up council finding was reproduced with four failing tests and fixed: an empty configured endpoint now uses the same default as the SDK.
  • Package changeset covers MCP and both SDK package names.

@tim-kos
tim-kos requested a review from kvz September 23, 2026 10:31
@tim-kos tim-kos self-assigned this Sep 23, 2026
@kvz kvz changed the title Restrict MCP file inputs and server-side URL downloads Harden MCP file and Assembly access Sep 23, 2026
@kvz
kvz merged commit 10febdc into main Sep 23, 2026
14 checks passed
@kvz
kvz deleted the fix/mcp-public-file-inputs branch September 23, 2026 16:02
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.

2 participants