Yubico / yubico-pam

Yubico Pluggable Authentication Module (PAM)
https://developers.yubico.com/yubico-pam
BSD 2-Clause "Simplified" License
689 stars 114 forks source link

Trying to authenticate with password + partial key submits partial password #211

Open mptyspace opened 4 years ago

mptyspace commented 4 years ago

Ran into an issue recently where a user failed to authenticate with a password + ubikey combination.

When we checked the logs to find out why authentication was failing it turned out the plugin was transmitting a partial password + part of a ubikey to the authentication server. It turned out the issue was that the ubikey was only put half into the authentication field.

It looks like the check to see whether its a password + ubikey is only checking if the full password length (password + ubikeycode) is longer than the ubi code + ubi id. Wouldn't a better check the full password string for the following segments:

  1. password
  2. the ubi id associated with the username
  3. ubi code

And fail when the ubi id is not matching or, when the ubi code is not the correct length, or when there is no password.