Skip to content

fix(auth): verify against every published proof record, not just the first - #1849

Merged
rdimitrov merged 2 commits into
modelcontextprotocol:mainfrom
Shanmukh-l33t:fix-1679-http-domain-auth-signature-verification
Nov 12, 2026
Merged

rdimitrov merged 2 commits into
modelcontextprotocol:mainfrom
Shanmukh-l33t:fix-1679-http-domain-auth-signature-verification

Conversation

@Shanmukh-l33t

@Shanmukh-l33t Shanmukh-l33t commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Authentication suites pass with the race detector.
  • Regression tests reproduce the original first-record-only failure and pass with the change.
  • Added security tests for mixed Ed25519/P-384 records, malformed and unsupported keys, duplicate records, incorrect signatures, expired/future timestamps, key retirement, HTTP versus DNS permissions, and HTTP responses at/above the size limit.
  • HTTP security tests exercise the production fetcher against a local TLS server.
  • make lint validate passes, including the corrected Staticcheck selector.
  • Rebased onto current main, including its Cargo 404-handling fix. Fresh CI passed on 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.

Shanmukh-l33t and others added 2 commits November 12, 2026 18:56
…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.

@rdimitrov rdimitrov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@rdimitrov
rdimitrov merged commit c9f8169 into modelcontextprotocol:main Nov 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants