Client-credentials examples should require issuer binding
GHSA-qx49-fqc8-xw99 and GHSA-6qxp-vccf-f47h say upgrading the MCP SDK does not close machine-to-machine credential redirection. The caller must pass issuer= (Python) or expectedIssuer (TypeScript), or a pre-provisioned secret follows whatever authorization server the MCP server advertises.
A client-credentials example that omits that argument should be non-compliant. A lint that fails the build on the omission: https://github.com/LHMisme420/mcp-authscan/blob/main/.github/workflows/example-issuer.yml
Endorsing this. Examples are the part of a spec that gets copied, so an example that omits issuer binding is effectively a recommendation to build the redirectable version. Treating the omission as non-compliant is the right bar, and the lint makes the bar checkable instead of aspirational.
A few things worth pinning down in the text:
- Client credentials is the case where response-side
issrules cannot help, because no authorization response exists and no user is in the loop. That makes the client-side binding the only anchor: the caller must verify that the token endpoint it is about to send provisioned credentials to is the issuer it intended, rather than trusting whatever authorization server a resource server advertises through its metadata. - It pairs with resource indicators. The
resourceparameter says where a token is valid; the issuer binding says who minted it. Examples should show both together, since one without the other still leaves a redirection path. - Naming: Python
issuer=and TypeScriptexpectedIssuerread as different concepts to someone comparing the two. A spec line that names the concept (issuer binding) and lets each SDK stay idiomatic would keep docs and lint aligned. - The lint is a good artifact. If it can run as a required check on the example files in CI, the rule keeps enforcing itself on future edits, which is where example-level norms usually rot.
On the two advisories: a short note in the examples that upgrading the SDK alone does not close this, the argument must actually be passed, is worth including. "We upgraded" is the instinct that would otherwise leave a reader exposed while believing they are patched.
I found a concrete first-party target, but it is narrower than a repo-wide syntax rule.
At conformance commit c37eec888e1c6ff140af79987a40008548b7cc5f, the official TypeScript everything client constructs both PrivateKeyJwtProvider and ClientCredentialsProvider without expectedIssuer. The corresponding scenario context has no authorization-server issuer field, and the referee supplies only the client ID/key (likewise ID/secret at lines 377–383). I ran mcp-authscan==0.9.4 against that exact commit; C1 reported those two call sites.
By contrast, the current Python client-credentials story/tutorial and TypeScript machine-auth/oauth-client-credentials examples I checked already pass issuer/expectedIssuer.
A focused fix would be to add the exact AS metadata issuer to both conformance context variants, thread it into the example and SDK conformance clients, and add a negative scenario: credentials are provisioned for AS A, protected-resource metadata advertises AS B, and the run must fail before any client authentication reaches B's token endpoint. That tests the normative binding behavior, rather than only the spelling of an SDK-specific argument.
A broad grep-style gate should exclude intentional omission/deprecation tests and avoid treating constructor syntax as the invariant; aliases, spreads, wrappers, or a custom provider can make syntax diverge from behavior.
AI disclosure: I used ChatGPT to search current first-party sources, run the published scanner on a clean checkout, and draft this review; I verified the cited paths and result.
Hi, I’d like to work on this issue. I’m interested in improving the client-credentials examples to ensure proper authorization server issuer binding. Would it be okay if I investigate the affected conformance examples, implement a focused fix, and add tests to verify that credentials cannot be redirected to an unexpected issuer? I’ll first review the existing implementation and contributing guidelines before submitting a PR.