Skip to content

TLS client auth optional allows nopass ACL users to authenticate without client certificates (CN-based auth bypass) #14638

Closed

Description

@sandeepkunusoth

Describe the bug

When tls-auth-clients is set to optional, an ACL user configured with nopass (intended to be “cert/CN-only”) can still authenticate without presenting a client certificate by simply running AUTH (no password). This allows CN-style usernames to behave like passwordless accounts even when no mTLS client cert is provided.

To reproduce

Start Valkey with TLS enabled and client certs optional:

tls-enabled yes
tls-auth-clients optional

Configure an ACL user that is intended to be authenticated via client cert CN:

ACL SETUSER svc-cn-user on nopass +get +set ~cache:*

Connect to Valkey over TLS without providing a client certificate (server TLS only).

Authenticate as the CN-style user without a password:

AUTH svc-cn-user

Observe that authentication succeeds and the user can run allowed commands.

Expected behavior

svc-cn-user should be usable only when the client presents a valid TLS client certificate whose CN = svc-cn-user.

If no client certificate is presented (because tls-auth-clients optional), AUTH svc-cn-user (no password) should fail (or there should be a supported mechanism to enforce “cert required” per user).

Additional information

We support dual-mode auth:

mTLS client cert auth (username derived from cert CN)
password auth for some clients

The concern is that, in mixed mode, a CN-based user configured with nopass can authenticate without a client cert, which defeats the intent of tying identity to certificate possession.

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