Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed SSH client key validation #71

Merged
merged 1 commit into from
Oct 3, 2022
Merged

Conversation

marenamat
Copy link
Contributor

The strings.HasPrefix() call was used with flipped argument order, allowing to match incomplete rows in the authorized_keys file to any key matching that prefix. In worst case, a line like

ecdsa-sha2-nistp256

with no key at all would match all keys of that type.

On the other hand, when the key was followed by a comment (or anything else) as is common in authorized_keys files, it wasn't matched at all.

The strings.HasPrefix() call was used with flipped argument order,
allowing incomplete rows in the authorized_keys file to any key matching
that prefix. In worst case, a line like

  ecdsa-sha2-nistp256

with no key at all would match all keys of that type.

On the other hand, when the key was followed by a comment as is common
in authorized_keys files, it wasn't matched at all.
@job job merged commit 33ae5d9 into bgp:master Oct 3, 2022
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