From 4f1b4f8c03b75ab8ea7585306b0fd7af3a20be2e Mon Sep 17 00:00:00 2001 From: Oliver Kieselbach Date: Thu, 24 Sep 2026 18:33:32 +0200 Subject: [PATCH] fix(mcp): URL-encode the registration id in the tenant-client lookup path The registration lookup put a client_id-derived value into the backend URL path unencoded. The amc_ regex already limits it to 32 hex characters, so nothing changes at runtime, but every other request-derived path segment in the MCP server goes through encodeURIComponent, and CodeQL counts only that (or a ?/# prefix) as a request-forgery barrier - a regex capture group is not one. Closes code-scanning alert js/request-forgery on oauth.ts. Co-Authored-By: Claude Opus 5.5 (1M context) --- src/McpServer/autopilot-monitor-mcp/src/oauth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/McpServer/autopilot-monitor-mcp/src/oauth.ts b/src/McpServer/autopilot-monitor-mcp/src/oauth.ts index 9d5d0b3c..f7a8508a 100644 --- a/src/McpServer/autopilot-monitor-mcp/src/oauth.ts +++ b/src/McpServer/autopilot-monitor-mcp/src/oauth.ts @@ -605,7 +605,7 @@ async function lookupTenantClient(registrationId: string): Promise