bgp / stayrtr

RPKI-To-Router server implementation in Go
BSD 3-Clause "New" or "Revised" License
91 stars 13 forks source link

Fixed SSH client key validation #71

Closed marenamat closed 1 year ago

marenamat commented 1 year ago

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.