Resource URI template expands without path-traversal guards
A resource URI template places a path parameter inside a filesystem-shaped scheme without evident sanitisation.
What it means
MCP resources/templates/list returns parameterised URIs like `file:///docs/{path}` or `s3://bucket/{path*}`. When the server inserts the parameter into the filesystem path without allowlist or path-traversal checks, any client (or a model picking a value) can read anything the process has access to: `{path} = ../../etc/passwd`, `{path} = ..%2F..%2Froot%2F.ssh%2Fid_rsa`, `{path} = /etc/shadow`. The check reads the template string, not the server's sanitiser — it's a metadata signal, not a confirmed exploit. Three bands: high: unbounded `{path*}` explode directly inside a filesystem-shaped scheme (file://, s3://, gs://, azure://, ftp:, no scheme) medium: simple `{name}` segment in a filesystem-shaped URI info: same patterns under https:// (API endpoints — less likely to be local traversal, but still worth noting)
How to fix
Scope every template to a specific base directory and enforce it server-side. Reject expansions containing `..`, `./`, URL-encoded separators (`%2F`, `%5C`), absolute paths or null bytes before resolving. Prefer `{id}` with a server-maintained id→path mapping over raw filesystem exposure. The Python MCP SDK ships `secure_filename`-style helpers; many other SDKs do not.
See it live
Our demo MCP server trips URITEMPLATE-001 on purpose. Scan it and you'll see this exact finding with evidence and fix text.
npx -y @patchbay-nebius/agent audit https://demo.patchbay-mcp.dev/mcpRun the check against your own server:
npx -y @patchbay-nebius/agent audit <url-or-directory>No install: scan an MCP server in the browser and get a shareable report.
Disagree with this finding on your server? Open an issue with the --json output. False-positive reports are the most useful feedback.