CVE-2024-39905: Red DiscordBot Red-DiscordBot Vulnerable To Incorrect Authorization Vulnerability

MODERATE
Advisory Identifier: GHSA-5jq8-q6rj-9gq4
CVSS 5.3
CWE-863
Published
Advisory Summary

CVE-2024-39905 is a MODERATE (CVSS 5.3) red-discordbot vulnerable to incorrect authorization vulnerability (CWE-863: Incorrect Authorization) affecting Red DiscordBot libraries in the PyPI ecosystem. The issue involves red-discordbot vulnerable to incorrect authorization in commands api. Remediation is available by upgrading affected packages to version 3.5.10.

CVE-2024-39905 at a Glance

CVE Identifier CVE-2024-39905
GHSA Identifier GHSA-5jq8-q6rj-9gq4
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-863: Incorrect Authorization
Affected Product Red DiscordBot
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.3

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

How to Fix CVE-2024-39905

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

Red-DiscordBot fixed: 3.5.10
pip install Red-DiscordBot>=3.5.10
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 Red-DiscordBot

How to Check if You Are Affected

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

pip show Red-DiscordBot

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Red DiscordBot, 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 Due to a bug in Red's Core API, 3rd-party cogs using the [`@commands.can_manage_channel()`](https://docs.discord.red/en/stable/framework_checks.html#redbot.core.commands.can_manage_channel) command permission check without additional permission controls may authorize a user to run a command even when that user doesn't have permissions to manage a channel. None of the core commands or core cogs are affected. The maintainers of the project are not aware of any _public_ 3rd-party cog utilizing this API at the time of writing this advisory. The [`@commands.mod_or_can_manage_channel()`](https://docs.discord.red/en/stable/framework_checks.html#redbot.core.commands.mod_or_can_manage_channel), [`@commands.admin_or_can_manage_channel()`](https://docs.discord.red/en/stable/framework_checks.html#redbot.core.commands.admin_or_can_manage_channel), and [`@commands.guildowner_or_can_manage_channel()`](https://docs.discord.red/en/stable/framework_checks.html#redbot.core.commands.guildowner_or_can_manage_channel) command permission checks are unaffected. CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N/AU:Y/R:U/RE:L ### Patches The problem was patched in PR #6398 and later released in version [3.5.10](https://pypi.org/project/Red-DiscordBot/3.5.10/). ### Workarounds Any cog using the [`@commands.can_manage_channel()`](https://docs.discord.red/en/stable/framework_checks.html#redbot.core.commands.can_manage_channel) command permission check should be unloaded until an upgrade to a patched version can be performed. ### References https://github.com/Cog-Creators/Red-DiscordBot/pull/6398 https://github.com/Cog-Creators/Red-DiscordBot/releases/tag/3.5.10 https://pypi.org/project/Red-DiscordBot/3.5.10/

CVE-2024-39905 Affected Red DiscordBot Versions

1 component(s)
Fixed Versions:
3.5.10
Product / Package Ecosystem Affected Versions Fixed Version
Red-DiscordBot
PyPI
≥ 3.5.0
< 3.5.10
3.5.10

References

Frequently Asked Questions

What is CVE-2024-39905?
CVE-2024-39905 is a security vulnerability in Red DiscordBot involving Red-DiscordBot vulnerable to Incorrect Authorization in commands API under CWE-863: Incorrect Authorization.
Which Red DiscordBot versions are affected?
Affected versions include releases prior to 3.5.10 across affected packages: Red-DiscordBot.
What version fixes CVE-2024-39905?
Upgrading to 3.5.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is Red-DiscordBot affected?
Yes, Red-DiscordBot is affected in releases prior to 3.5.10. Upgrade your dependency to 3.5.10 or later.
What is the CVSS score of CVE-2024-39905?
CVE-2024-39905 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2024-39905?
CVE-2024-39905 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check PyPI dependencies for CVE-2024-39905?
Run the dependency tree command: 'pip show Red-DiscordBot'. 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-5jq8-q6rj-9gq4",
  "modified" : "2024-07-11T18:33:32Z",
  "published" : "2024-07-11T17:32:42Z",
  "aliases" : [ "CVE-2024-39905" ],
  "summary" : "Red-DiscordBot vulnerable to Incorrect Authorization in commands API",
  "details" : "### Impact\n\nDue to a bug in Red's Core API, 3rd-party cogs using the [`@commands.can_manage_channel()`](https://docs.discord.red/en/stable/framework_checks.html#redbot.core.commands.can_manage_channel) command permission check without additional permission controls may authorize a user to run a command even when that user doesn't have permissions to manage a channel.\nNone of the core commands or core cogs are affected. The maintainers of the project are not aware of any _public_ 3rd-party cog utilizing this API at the time of writing this advisory.\n\nThe [`@commands.mod_or_can_manage_channel()`](https://docs.discord.red/en/stable/framework_checks.html#redbot.core.commands.mod_or_can_manage_channel), [`@commands.admin_or_can_manage_channel()`](https://docs.discord.red/en/stable/framework_checks.html#redbot.core.commands.admin_or_can_manage_channel), and [`@commands.guildowner_or_can_manage_channel()`](https://docs.discord.red/en/stable/framework_checks.html#redbot.core.commands.guildowner_or_can_manage_channel) command permission checks are unaffected.\n\nCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N\nCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N/AU:Y/R:U/RE:L\n\n### Patches\n\nThe problem was patched in PR #6398 and later released in version [3.5.10](https://pypi.org/project/Red-DiscordBot/3.5.10/).\n\n### Workarounds\n\nAny cog using the [`@commands.can_manage_channel()`](https://docs.discord.red/en/stable/framework_checks.html#redbot.core.commands.can_manage_channel) command permission check should be unloaded until an upgrade to a patched version can be performed.\n\n### References\n\nhttps://github.com/Cog-Creators/Red-DiscordBot/pull/6398\nhttps://github.com/Cog-Creators/Red-DiscordBot/releases/tag/3.5.10\nhttps://pypi.org/project/Red-DiscordBot/3.5.10/\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "Red-DiscordBot"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.5.0"
      }, {
        "fixed" : "3.5.10"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Cog-Creators/Red-DiscordBot/security/advisories/GHSA-5jq8-q6rj-9gq4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-39905"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Cog-Creators/Red-DiscordBot/pull/6398"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Cog-Creators/Red-DiscordBot/commit/0b0b23b9717b40ed4f8715720b199417c8e89750"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Cog-Creators/Red-DiscordBot"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-11T17:32:42Z",
    "nvd_published_at" : "2024-07-11T16:15:05Z"
  }
}