{"schema_version":"1.7.3","id":"GHSA-mcg6-h362-cmq5","published":"2022-03-11T20:52:04Z","modified":"2024-11-24T05:26:11.734324Z","aliases":["CVE-2022-0860","PYSEC-2022-177"],"summary":"Improper Authorization in cobbler","details":"### Impact\n\nIf 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).\n\nThe same applies to user accounts with passwords set to be expired.\n\n### Patches\n\nThere is a patch for the latest Cobbler `3.3.2` available, however a backport will be done for `3.2.x`.\n\n### Workarounds\n\n- Delete expired accounts which are able to access Cobbler via PAM.\n- Use `chage -l <username>` to lock the account. If the account has SSH-Keys attached then remove them completely.\n\n### References\n\n- Originally discovered by @ysf at https://www.huntr.dev/bounties/c458b868-63df-414e-af10-47e3745caa1d/\n\n### How to test if my Cobbler instance is affected?\n\nThe 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.\n\n```python\ndef test_pam_login_with_expired_user():\n    # Arrange\n    # create pam testuser\n    test_username = \"expired_user\"\n    test_password = \"password\"\n    test_api = CobblerAPI()\n    subprocess_1 = subprocess.run(\n        [\"perl\", \"-e\", \"'print crypt(\\\"%s\\\", \\\"%s\\\")'\" % (test_username, test_password)],\n        stdout=subprocess.PIPE\n    )\n    subprocess.run([\"useradd\", \"-p\", subprocess_1.stdout, test_username])\n    # change user to be expired\n    subprocess.run([\"chage\", \"-E0\", test_username])\n\n    # Act\n    result = pam.authenticate(test_api, test_username, test_password)\n\n    # Assert - login should fail\n    assert not result\n```\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [the Cobbler repository](https://github.com/cobbler/cobbler/issues/new/choose)\n* Ask in the [Gitter/Matrix Chat](https://gitter.im/cobbler/community)\n* Email us at [cobbler.project@gmail.com](mailto:cobbler.project@gmail.com)\n","affected":[{"package":{"name":"cobbler","ecosystem":"PyPI","purl":"pkg:pypi/cobbler"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.3.2"}]}],"versions":["0.6.3-2","3.1.2","3.2.1","3.2.2","3.2.3","3.3.0","3.3.1"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/03/GHSA-mcg6-h362-cmq5/GHSA-mcg6-h362-cmq5.json"}}],"references":[{"type":"WEB","url":"https://github.com/cobbler/cobbler/security/advisories/GHSA-mcg6-h362-cmq5"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-0860"},{"type":"WEB","url":"https://github.com/cobbler/cobbler/commit/9044aa990a94752fa5bd5a24051adde099280bfa"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-mcg6-h362-cmq5"},{"type":"PACKAGE","url":"https://github.com/cobbler/cobbler"},{"type":"WEB","url":"https://github.com/pypa/advisory-database/tree/main/vulns/cobbler/PYSEC-2022-177.yaml"},{"type":"WEB","url":"https://huntr.dev/bounties/c458b868-63df-414e-af10-47e3745caa1d"},{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/D4KCNZYBQC2FM5SEEDRQZO4LRZ4ZECMG"},{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DYWYHWVVRUSPCV5SWBOSAMQJQLTSBTKY"},{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IYSHMF6MEIITFAG7EJ3IQKVUN7MDV2XM"}],"database_specific":{"cwe_ids":["CWE-285","CWE-863"],"github_reviewed":true,"github_reviewed_at":"2022-03-11T20:52:04Z","nvd_published_at":"2022-03-11T13:15:00Z","severity":"MODERATE"},"severity":[{"type":"CVSS_V3","score":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N"},{"type":"CVSS_V4","score":"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"}]}