Skip to content

Embedded auth server signs with an Ed25519 key, but ToolHive's token validator refuses EdDSA tokens #7250

Closed

Description

@jhrozek

Problem

The embedded authorization server accepts an Ed25519 signing key and signs
its access tokens with EdDSA. ToolHive's token validator, which the vMCP and
proxy use to check those tokens, accepts only RSA and ECDSA signatures. So a
server configured with an Ed25519 key starts without an error, and then every
token it issues is refused with a 401. Nothing points at the key type.

Line numbers below are from v0.66.0.

  • pkg/authserver/server/keys/provider.go:58: NewFileProvider loads RSA,
    ECDSA, and Ed25519 PEM keys.
  • pkg/authserver/server/crypto/keys.go:128: DeriveAlgorithm returns
    EdDSA for an ed25519.PrivateKey, so tokens are signed with EdDSA.
  • pkg/auth/token.go:899: validateTokenHeader allows only
    *jwt.SigningMethodRSA and *jwt.SigningMethodECDSA, and refuses anything
    else with unexpected signing method.

This happens on the in-process path too, where the validator gets the auth
server's own keys through WithKeyProvider (pkg/auth/token.go:594,
pkg/vmcp/auth/factory/incoming.go:242). The key is found; the signing
method is refused before the signature is checked.

How to reproduce

  1. Generate an Ed25519 key: openssl genpkey -algorithm ed25519 -out as.pem.
  2. Run the embedded auth server with signing_key_config.signing_key_file
    set to as.pem, behind a vMCP that validates its tokens.
  3. Complete a login and call the vMCP with the issued access token.

Expected: the call succeeds. Actual: 401. The validator refuses the token
with unexpected signing method: EdDSA.

Possible fixes

  1. Accept EdDSA in validateTokenHeader (*jwt.SigningMethodEd25519). This
    is only complete if every path that checks these tokens handles Ed25519
    keys, including keys fetched from a remote JWKS (OKP keys) and the
    discovery metadata.
  2. Refuse an Ed25519 signing key in the embedded auth server, at key loading
    or config validation, with an error that names the supported key types.
    This matches the existing decision at
    pkg/authserver/server/crypto/keys.go:170-175, which leaves EdDSA out of
    client key algorithms because fosite cannot verify it.

Option 2 is smaller and fails at startup instead of at the first request.
Option 1 makes the documented Ed25519 support real.

Activity

  1. added
    needs-triage
    on Nov 23, 2026
  2. added a commit that references this issue on Nov 23, 2026
    48a829b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions