`OpenIdProviderDiscoveryMetadataSchema` strips `revocation_endpoint`, so clients can't revoke against OIDC-only authorization servers
Maintainer thường phản hồi trong vòng 1 ngày
@marcus-beauregard đang làm issue này rồi.
Từ ngày 19/11/2026.
- #3214 của @marcus-beauregard — đang mở
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- api, authentication
Hướng nghiên cứu
Bắt đầu tại src/shared/auth.ts, ở OpenIdProviderDiscoveryMetadataSchema, rồi so sánh với OpenIdProviderMetadataSchema và OAuthMetadataSchema. Tái hiện lần parse được báo cáo với revocation_endpoint để xác nhận những trường nào bị loại bỏ. Công việc hoàn tất khi schema discovery OpenID giữ lại endpoint thu hồi được công bố và lỗi hồi quy được bao phủ bằng một bài kiểm thử.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
When authorization server metadata comes from OpenID Connect discovery, parsing it with OpenIdProviderDiscoveryMetadataSchema silently drops revocation_endpoint, along with any other RFC 8414 field that isn't declared. A client that later looks for revocation_endpoint concludes the server doesn't support revocation, even though the discovery document lists it.
Where
src/shared/auth.ts in @modelcontextprotocol/sdk 1.32.2 (with zod 4.6.7):
export const OpenIdProviderDiscoveryMetadataSchema = z.object({
...OpenIdProviderMetadataSchema.shape,
...OAuthMetadataSchema.pick({
code_challenge_methods_supported: true
}).shape
});
OpenIdProviderMetadataSchemais az.looseObject, but spreading.shapeinto a plainz.objectdrops the loose behaviour. In zod v4, unknown keys are stripped.OpenIdProviderMetadataSchemadoesn't declarerevocation_endpoint.- The only OAuth metadata field picked in is
code_challenge_methods_supported. - So the parsed result never contains
revocation_endpoint.
Impact
Some authorization servers publish metadata only through OpenID discovery and return an error for the RFC 8414 paths. Amazon Cognito is one. Against those servers, clients built on the SDK never revoke on logout.
We see this in Claude Code 2.1.328: claude mcp logout <server> deletes the local credentials but logs Server does not support token revocation, and no revoke request reaches the server. The discovery document does list revocation_endpoint.
By contrast, anthropics/claude-code#105134 reports that logout does send revoke requests for servers that serve RFC 8414 metadata. That fits this being specific to the OpenID discovery path.
Repro
import { OpenIdProviderDiscoveryMetadataSchema, OAuthMetadataSchema } from "@modelcontextprotocol/sdk/shared/auth.js";
const doc = {
issuer: "https://issuer.example.com",
authorization_endpoint: "https://issuer.example.com/oauth2/authorize",
token_endpoint: "https://issuer.example.com/oauth2/token",
jwks_uri: "https://issuer.example.com/.well-known/jwks.json",
response_types_supported: ["code"],
subject_types_supported: ["public"],
id_token_signing_alg_values_supported: ["RS256"],
code_challenge_methods_supported: ["S256"],
revocation_endpoint: "https://issuer.example.com/oauth2/revoke",
};
console.log(OpenIdProviderDiscoveryMetadataSchema.parse(doc).revocation_endpoint); // undefined
console.log(OAuthMetadataSchema.parse(doc).revocation_endpoint); // "https://issuer.example.com/oauth2/revoke"
(Run against 1.32.2: the first line prints undefined, the second prints the URL.)
Suggested fix
Either:
- keep unknown keys, by building the schema with
z.looseObject({...})or.loose(); or - spread the optional RFC 8414 fields that OpenID discovery documents commonly carry, such as
revocation_endpoint,introspection_endpointandrevocation_endpoint_auth_methods_supported.
Related: #2733 and #2734 (the same schema, about over-strict validation rather than dropped fields), and the closed #739 (a client revocation helper).
- Ngôn ngữ chính
- TypeScript
- Star
- 13.8k
- Fork
- 2.5k
- Merge trung bình
- 6 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/typescript-sdk
-
v2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
modelcontextprotocol/typescript-sdk#3270 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`callTool` with `allowInputRequired: true` throws on an `input_required` result when the tool declares an `outputSchema`Có thể đã có người làm @mgoldsborough đã nhận 6 ngày trước. Đang mởv2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
modelcontextprotocol/typescript-sdk#3249 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
modelcontextprotocol/typescript-sdk#3243 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
TypeScript client accepts an unknown `resultType` in the first `server/discover` replyCó thể đã có người làm @Tidehyc đã nhận 7 ngày trước. Đang mởv2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
modelcontextprotocol/typescript-sdk#3235 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
UriTemplate.match() throws a TypeError on an empty expression it acceptsCó thể đã có người làm @yunusemrejs đã nhận 12 ngày trước. Đang mởv1 v2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
modelcontextprotocol/typescript-sdk#3221 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelcontextprotocol/typescript-sdk
Issue tương tự
-
clawsweeper:intake:bug clawsweeper:intake:needs-environment
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
openclaw/openclaw#212827 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
KT-2245 e2e specs that call the backend directly fall back to the developer's own Kronn on :3140Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Use one constant for the 10,000-character input limitCó thể đã có người làm @NginxL đã nhận hôm nay. Đang mởgood first issue refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
aniru-dh21/snap-validate#51 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
dependencies effort: small good first issue priority: low
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
TMHSDigital/screencast-mcp#509 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
from-review tech-debt testing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
blamechris/chroxy#9520 ·
Maintainer thường phản hồi trong vòng 1 ngày