GHSA-mcg6-h362-cmq5

Suggest an improvement
Source
https://github.com/advisories/GHSA-mcg6-h362-cmq5
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/03/GHSA-mcg6-h362-cmq5/GHSA-mcg6-h362-cmq5.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-mcg6-h362-cmq5
Aliases
Published
2022-03-11T20:52:04Z
Modified
2024-11-24T05:26:11.734324Z
Severity
  • 8.2 (High) CVSS_V3 - CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N CVSS Calculator
  • 6.7 (Medium) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:U CVSS Calculator
Summary
Improper Authorization in cobbler
Details

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 cobbler.project@gmail.com

Database specific
{
    "nvd_published_at": "2022-03-11T13:15:00Z",
    "cwe_ids": [
        "CWE-285",
        "CWE-863"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2022-03-11T20:52:04Z"
}
References

Affected packages

PyPI / cobbler

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
3.3.2

Affected versions

0.*

0.6.3-2

3.*

3.1.2
3.2.1
3.2.2
3.2.3
3.3.0
3.3.1