From b4344098defe61a801dfd85712eb53f50faf4b25 Mon Sep 17 00:00:00 2001 From: Shoubhit Dash Date: Fri, 22 May 2026 16:45:40 +0530 Subject: [PATCH] fix(mcp): validate oauth callback port range --- packages/opencode/src/config/mcp.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/src/config/mcp.ts b/packages/opencode/src/config/mcp.ts index ae558a76b2..2a49745dd8 100644 --- a/packages/opencode/src/config/mcp.ts +++ b/packages/opencode/src/config/mcp.ts @@ -26,7 +26,7 @@ export const OAuth = Schema.Struct({ description: "OAuth client secret (if required by the authorization server)", }), scope: Schema.optional(Schema.String).annotate({ description: "OAuth scopes to request during authorization" }), - callbackPort: Schema.optional(PositiveInt).annotate({ + callbackPort: Schema.optional(Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 65535 }))).annotate({ description: "Port for the local OAuth callback server (default: 19876). Shorthand for redirectUri when only the port needs changing. Ignored if redirectUri is set.", }),