Skip to content

External JWTs without an exp claim are accepted and never expire #4800

Open

Description

@dmuensterer

Affected: controllers with an enabled ext-jwt-signer whose issuer emits tokens without exp

Problem

External tokens are parsed with jwt.ParseWithClaims and no parser options:

  • controller/model/token_provider_cache.go:428 (TokenIssuerCache.VerifyTokenByInspection)
  • controller/model/token_provider_cache.go:642 (TokenIssuerExtJwt.VerifyToken)

golang-jwt/jwt/v5 validates exp only when the claim is present, so a validly signed token without exp passes. Ext-jwt authentication (common/security_tokens.go:472) and enrollment with an external token (controller/model/enrollment_mod_token.go:300, :333) both go through these calls.

Impact

Once leaked, such a token can be replayed indefinitely to authenticate or enroll. It can only be invalidated by rotating the signing key or disabling the signer.

Signature, issuer and audience checks are not affected. Providers that follow OIDC always set exp; custom token minters may not.

Expected

Both calls pass jwt.WithExpirationRequired(), so a token without exp is rejected.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions