Vulnerabilities in pkg:pypi/py-cord

PACKAGE
Advisory Identifier: GHSA-qmhj-m29v-gvmr
Advisory Summary

CVE-2022-36024 is a HIGH (CVSS 7.5) remote code execution vulnerability (CWE-284: Improper Access Control) affecting Py cord libraries in the PyPI ecosystem. The issue involves bots using py-cord as discord api wrapper are vulnerable to shutdowns through remote code execution. Remediation is available by upgrading affected packages to version 2.0.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/py-cord

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/py-cord. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-qmhj-m29v-gvmr CVE-2022-36024 HIGH Bots using py-cord as Discord API wrapper are vulnerable to shutdowns through remote code execution

CVE-2022-36024 at a Glance

CVE Identifier CVE-2022-36024
GHSA Identifier GHSA-qmhj-m29v-gvmr
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-284: Improper Access Control
Affected Product Py cord
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

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

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 None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2022-36024

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

py-cord fixed: 2.0.1
pip install py-cord>=2.0.1
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 py-cord

How to Check if You Are Affected

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

pip show py-cord

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In Py cord, 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 py-cord is a an API wrapper for Discord written in Python. Bots using py-cord version 2.0.0 are vulnerable to remote shutdown if they are added to the server with the `application.commands` scope without the `bot` scope. Currently, it appears that all public bots that use slash commands are affected. ### Patches This issue has been patched in version 2.0.1. ### Workarounds There are currently no recommended workarounds - please upgrade to a patched version. ### References https://github.com/Pycord-Development/pycord/pull/1568 ### For more information If you have any questions or comments about this advisory: * Open an issue in [our GitHub](https://github.com/Pycord-Development/pycord) * Email us at [support@pycord.dev](mailto:support@pycord.dev)

CVE-2022-36024 Affected Py cord Versions

1 component(s)
Fixed Versions:
2.0.1
Product / Package Ecosystem Affected Versions Fixed Version
py-cord
PyPI
≥ 2.0.0
< 2.0.1
All 1 versions
2.0.0
2.0.1

References

Frequently Asked Questions

What is CVE-2022-36024?
CVE-2022-36024 is a security vulnerability in Py cord involving Bots using py-cord as Discord API wrapper are vulnerable to shutdowns through remote code execution under CWE-284: Improper Access Control.
Which Py cord versions are affected?
Affected versions include releases prior to 2.0.1 across affected packages: py-cord.
What version fixes CVE-2022-36024?
Upgrading to 2.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is py-cord affected?
Yes, py-cord is affected in releases prior to 2.0.1. Upgrade your dependency to 2.0.1 or later.
What is the CVSS score of CVE-2022-36024?
CVE-2022-36024 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2022-36024?
CVE-2022-36024 is classified under CWE-284: Improper Access Control (The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.).
How can I check PyPI dependencies for CVE-2022-36024?
Run the dependency tree command: 'pip show py-cord'. 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-qmhj-m29v-gvmr",
  "modified" : "2024-11-26T18:46:54Z",
  "published" : "2022-08-18T14:18:37Z",
  "aliases" : [ "CVE-2022-36024" ],
  "summary" : "Bots using py-cord as Discord API wrapper are vulnerable to shutdowns through remote code execution",
  "details" : "### Impact\npy-cord is a an API wrapper for Discord written in Python. Bots using py-cord version 2.0.0 are vulnerable to remote shutdown if they are added to the server with the `application.commands` scope without the `bot` scope. Currently, it appears that all public bots that use slash commands are affected.\n\n### Patches\nThis issue has been patched in version 2.0.1.\n\n### Workarounds\nThere are currently no recommended workarounds - please upgrade to a patched version.\n\n### References\nhttps://github.com/Pycord-Development/pycord/pull/1568\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [our GitHub](https://github.com/Pycord-Development/pycord)\n* Email us at [support@pycord.dev](mailto:support@pycord.dev)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "py-cord"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.1"
      } ]
    } ],
    "versions" : [ "2.0.0" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Pycord-Development/pycord/security/advisories/GHSA-qmhj-m29v-gvmr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-36024"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Pycord-Development/pycord/pull/1568"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Pycord-Development/pycord"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/py-cord/PYSEC-2022-43146.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-284" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-08-18T14:18:37Z",
    "nvd_published_at" : "2022-08-18T15:15:00Z"
  }
}