[SOLVED] Successful login with empty password (Realm: Linux PAM standard authentication)

n.borisenkov

New Member
Dec 23, 2022
6
0
1
Under certain conditions, it is possible to log in to the web interface without knowing the user password.

To create users on hosts, we use ansible playbook. There was an error in the playbook and one user had an incorrect password hash installed in /etc/shadow

To log in via SSH, we use SSH keys, but a password is set for PVE hosts. In the PVE web interface we use PAM authentication.

What’s interesting is that if you enter an incorrect password hash or remove the password altogether using "passwd <login> --delete", you can still log in to PVE using any password.

The logs show the following message:
Code:
IPCC.xs[923128]: pam_unix(proxmox-ve-auth:auth): user [test-user] has blank password; authenticated without it
pvedaemon[923128]: <root@pam> successful authentication for user 'test-user@pam'

At first I tried to find this message in the PVE sources, but then I realized that this message was from the PAM subsystem and had nothing to do with PVE.

It's all about the settings in the file /etc/pam.d/common-auth
Code:
...
auth [success=1 default=ignore] pam_unix.so nullok
...

"nullok" allows logging in with a blank password. I tried logging into the Linux console and it worked. But it doesn't allow it via SSH because of "PermitEmptyPasswords" in the sshd config.

It seems to me that it is unsafe to allow the user to log into the administration interface when the password is not specified.

Is that how it was intended?
Maybe in future versions of PVE we can remove "nullok"?
 
"nullok" allows logging in with a blank password. I tried logging into the Linux console and it worked. But it doesn't allow it via SSH because of "PermitEmptyPasswords" in the sshd config.
This is normal behaviour - at least in Debian and RHEL, so I think this is intended.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!