CVE-2022-0860: Cobbler Improper Authorization Vulnerability

MODERATE
Advisory Identifier: GHSA-mcg6-h362-cmq5
CVSS 8.2
CWE-285 CWE-863
Published
Advisory Summary

CVE-2022-0860 is a MODERATE (CVSS 8.2) improper authorization vulnerability (CWE-285: Improper Authorization) affecting Cobbler libraries in the PyPI ecosystem. The issue involves improper authorization in cobbler. Remediation is available by upgrading affected packages to version 3.3.2.

CVE-2022-0860 at a Glance

CVE Identifier CVE-2022-0860
GHSA Identifier GHSA-mcg6-h362-cmq5
Severity MODERATE
CVSS v3.1 Base Score 8.2
CWE Classification CWE-285: Improper Authorization
Affected Product Cobbler
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2022-0860

To remediate this vulnerability, upgrade all affected Cobbler dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

cobbler fixed: 3.3.2
pip install cobbler>=3.3.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show cobbler

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2022-0860, inspect your installed packages using pip:

pip show cobbler

Analyze the terminal output to locate any version of Cobbler in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.3.2), your application is affected.

Note: The pip show cobbler command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-285: Improper Authorization, where the product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action. In Cobbler, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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. ```python 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](https://github.com/cobbler/cobbler/issues/new/choose) * Ask in the [Gitter/Matrix Chat](https://gitter.im/cobbler/community) * Email us at [cobbler.project@gmail.com](mailto:cobbler.project@gmail.com)

CVE-2022-0860 Affected Cobbler Versions

1 component(s)
Fixed Versions:
3.3.2
Product / Package Ecosystem Affected Versions Fixed Version
cobbler
PyPI
< 3.3.2
3.3.2

References

Frequently Asked Questions

What is CVE-2022-0860?
CVE-2022-0860 is a security vulnerability in Cobbler involving Improper Authorization in cobbler under CWE-285: Improper Authorization.
Which Cobbler versions are affected?
Affected versions include releases prior to 3.3.2 across affected packages: cobbler.
What version fixes CVE-2022-0860?
Upgrading to 3.3.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is cobbler affected?
Yes, cobbler is affected in releases prior to 3.3.2. Upgrade your dependency to 3.3.2 or later.
What is the CVSS score of CVE-2022-0860?
CVE-2022-0860 has a CVSS v3.1 base score of 8.2 (MODERATE) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2022-0860?
CVE-2022-0860 is classified under CWE-285: Improper Authorization (The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.).
How can I check PyPI dependencies for CVE-2022-0860?
Run the dependency tree command: 'pip show cobbler'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mcg6-h362-cmq5",
  "modified" : "2024-11-18T16:26:19Z",
  "published" : "2022-03-11T20:52:04Z",
  "aliases" : [ "CVE-2022-0860" ],
  "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",
  "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "cobbler"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.3.2"
      } ]
    } ]
  } ],
  "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" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-03-11T20:52:04Z",
    "nvd_published_at" : "2022-03-11T13:15:00Z"
  }
}