Improper Authorization in cobbler
Cobbler's PAM authentication did not check whether a user account was expired, so an expired account could still log in through the web UI, CLI and XMLRPC API. An attacker with an expired account could therefore keep using Cobbler despite the account being disabled.
cobbler/cobbler
Originally disclosed on huntr
Impact
If PAM is correctly configured and a user account is set to expired, the expired user-account is still able to successfully log into Cobbler in all places (Web UI, CLI & XMLRPC-API).
The same applies to user accounts with passwords set to be expired.
Patches
There is a patch for the latest Cobbler 3.3.2 available, however a backport will be done for 3.2.x.
Workarounds
- Delete expired accounts which are able to access Cobbler via PAM.
- Use
chage -l <username>to lock the account. If the account has SSH-Keys attached then remove them completely.
References
- Originally discovered by @ysf at https://www.huntr.dev/bounties/c458b868-63df-414e-af10-47e3745caa1d/
How to test if my Cobbler instance is affected?
The following pytest test assumes that your PAM setup is correct. In case the added user is not able to login, this test does not make sense to be executed.
def test_pam_login_with_expired_user():
# Arrange
# create pam testuser
test_username = "expired_user"
test_password = "password"
test_api = CobblerAPI()
subprocess_1 = subprocess.run(
["perl", "-e", "'print crypt(\"%s\", \"%s\")'" % (test_username, test_password)],
stdout=subprocess.PIPE
)
subprocess.run(["useradd", "-p", subprocess_1.stdout, test_username])
# change user to be expired
subprocess.run(["chage", "-E0", test_username])
# Act
result = pam.authenticate(test_api, test_username, test_password)
# Assert - login should fail
assert not result
For more information
If you have any questions or comments about this advisory:
- Open an issue in the Cobbler repository
- Ask in the Gitter/Matrix Chat
- Email us at [email protected]
From the GitHub Advisory Database (GHSA-mcg6-h362-cmq5, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely Cobbler's PAM authentication only validated the password and did not check the account expiry status returned by PAM.
What the attacker needed
PAM configured correctly; an expired user account; valid password for that account
The fix
A patch was made available for Cobbler 3.3.2, with a backport planned for 3.2.x.
How it was found
- Create a PAM test user with a known password.
- Mark the user account as expired.
- Attempt to authenticate to Cobbler with that user.
- Observe that the login succeeds instead of failing.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
PAM is a common Linux system that checks usernames and passwords. When an account is marked as expired, the system should refuse logins, but Cobbler only asked PAM whether the password was correct and ignored the expiry flag. That meant a disabled account could still get into Cobbler.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.