-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8b4f60a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I'm having a password of 160 characters and this change is affecting me.
https://gitlab.alpinelinux.org/alpine/aports/issues/10659
8b4f60a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We just faced this as well: MichaIng/DietPi#5849
If high SSH security is wanted, key authentication makes more sense, so >100 character passwords used for SSH login are likely very rare, but it can be surprising for these rare cases when the same password works well on OpenSSH (and local login anyway).
@mkj
There is a changelog about it, but I don't really understand why this limit was introduced. Could you explain, when you find time?
8b4f60a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The time taken for glibc to crypt() a password is proportional to the length of the password (a bad design, in retrospect). The problem is that we only know which salt to use for a user once we lookup the user, so can't (*) run a fake crypt() if the user doesn't exist. Instead Dropbear waits for a fixed time delay. But if the password is too long, the crypt() time will be longer than the time delay, so it's possible to tell if a particular username exists.
I think what OpenSSH does is use the salt of the root user instead (*), which would probably be OK in most cases (unless the salt has changed during the system's lifetime). The other option would be to not worry about leaking the existence of users ("security through obscurity"), though I guess there might be systems where usernames are somewhat sensitive. I'll have a look how much complexity there is if it uses another salt for the crypt().
Realistically I don't think there's any point to a very large password for online logins - you are limited to a few tries per second. Offline passwords for encryption are a different matter.
8b4f60a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarification. I agree that such a long password for SSH doesn't make so much sense, given that pubkey authentication can be used instead. It's probably relevant for some cases where a long password is used to protect other login ways and where pubkey authentication isn't feasible/possible for some reason. It isn't possible to pass the "Too-long password attempt" error to the client prompt, is it?
8b4f60a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8b4f60a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why make the limit very small, 100 characters?
I realize it needs to be allocated and that the password is stored as a salted hash that is much shorter than the possible length proving that you aren't able to allocate the exact length.
Why don't you read the input into memory to 5000 bytes instead of 100 bytes?
Your changelog says:
If you are trying to avoid revealing valid usernames, you would know they use a single character (or the minimum) password length. You should allocate a random amount between length and 5000 to require at least 5000 providing more time for temperature to change. That makes it more difficult to guess the logins.
8b4f60a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the issue about this - #237