Repository navigation
fix(auth): verify against every published proof record, not just the first - #1849
Conversation
…first
ParseMCPKeysFromStrings only extracted the first MCPv1 record from each
fetched string. The HTTP key fetch returns the whole well-known response
body as one string, so a body carrying more than one proof record — e.g. a
stale record left in place while rotating to a new key — verified only
against the stale key. A signature made with the matching published key
was then rejected with "signature verification failed ... the published
record may be stale" even though the matching key was present in the
served record.
Extract every record with FindAllStringSubmatch so the existing
multi-key verification path ("signature verification failed against all
N published keys ... if you recently rotated keys") applies to HTTP
bodies the way it already does to multiple DNS TXT records.
0935834 to
bde8260
Compare
rdimitrov
left a comment
There was a problem hiding this comment.
Reviewed the rebased parser change, security regression tests, and key-retirement documentation. Authentication still requires a valid signature from a published key, and timestamp, namespace, and HTTP fetch protections remain unchanged. The documentation correctly explains that every published key stays authorized, removing a key prevents new logins once updated records are fetched, and already-issued tokens remain valid until expiry.
Authentication suites passed locally with the race detector; lint and schema validation passed. Fresh CI is green, including all tests and deployment checks: https://github.com/modelcontextprotocol/registry/actions/runs/43264349434. The unsupported automatic closure of #1679 has been removed.
Problem and change
HTTP authentication parsed only the first MCPv1 proof record in the well-known response body. During key rotation, a signature using a second published key was rejected even though its proof record was present.
Parse every matching record in each fetched string and pass the keys to the existing signature-verification logic. The shared parser also supports multiple proof records within one DNS TXT record; multiple separate TXT records already worked.
Security and key retirement
Every valid published key can authenticate, regardless of record order. Publishing a new key does not revoke an old one: remove all copies of retired proof records and account for CDN/DNS caches. Already issued Registry tokens remain valid until expiry. The authentication guide now documents overlap, retirement, and compromised-key handling.
Signature verification, timestamp validation, namespace permissions, and HTTP TLS, redirect, network, and 4096-byte body protections remain unchanged.
Validation
make lint validatepasses, including the corrected Staticcheck selector.bde8260, including all tests and deployment checks.Related report: #1679. This change reproduces and fixes the multi-record limitation; it does not establish the cause of that report's single-record authentication failure and should not automatically close it.
Prepared with AI assistance.