Skip to content

Limit server number of public key queries#398

Merged
mkj merged 3 commits intomasterfrom
pr/pubkey-query-limit
Jan 17, 2026
Merged

Limit server number of public key queries#398
mkj merged 3 commits intomasterfrom
pr/pubkey-query-limit

Conversation

@mkj
Copy link
Copy Markdown
Owner

@mkj mkj commented Jan 17, 2026

A ssh client queries a server whether a public key will be accepted
prior to performing a real signature. Previously there was no limit on
the number of queries.

Public key queries are a user enumeration/privacy concern if an attacker
iterates with known public keys such as those published by github
(mapping to github usernames). If total privacy is required, the proper
solution is to use separate authorized_keys compared to publicly used
ones (or avoid services that publish public keys).

As a mitigation for reused public keys, Dropbear now limits to 15 public
keys attempts per session. Public key queries start being counted as
failed authentication attempts after (MAX_AUTH_TRIES - MAX_PUBKEY_QUERIES).
This provides a rate limit on public key queries.

Reported by HD Moore, details are in the SSHamble presentation.

mkj added 3 commits January 17, 2026 22:10
Setting MAX_AUTH_TRIES (or -T) to 0 is a valid configuration - it
requires the first authentication attempt to succeed.
A ssh client queries a server whether a public key will be accepted
prior to performing a real signature. Previously there was no limit on
the number of queries.

Public key queries are a user enumeration/privacy concern if an attacker
iterates with known public keys such as those published by github
(mapping to github usernames). If total privacy is required, the proper
solution is to use separate authorized_keys compared to publicly used
ones (or avoid services that publish public keys).

As a mitigation for reused public keys, Dropbear now limits to 15 public
keys attempts per session.  Public key queries start being counted as
failed authentication attempts after (MAX_AUTH_TRIES - MAX_PUBKEY_QUERIES).
This provides a rate limit on public key queries.

Reported by HD Moore, details are in the SSHamble presentation.
@mkj mkj merged commit db0d3fd into master Jan 17, 2026
31 of 33 checks passed
@mkj mkj deleted the pr/pubkey-query-limit branch January 17, 2026 11:20
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.

1 participant