Skip to content

Missing authorization check in `-config` command

High
virtual-designer published GHSA-crgg-w3rr-r9h4 Sep 3, 2024

Package

sudobot (GitHub)

Affected versions

< 9.26.7

Patched versions

9.26.7

Description

Impact

Privilege escalation and exploit of the -config command. Anyone is theoretically able to update any configuration of the bot and potentially gain control over the bot's settings.
Every version of v9 before v9.26.7 is affected. Other versions (e.g. v8) are not affected.

Patches

This issue was immediately patched when we discovered it. Everyone is advised to upgrade to v10 as soon as possible, although you can also upgrade to v9.26.7.

Workarounds

A workaround would be to create a command permission overwrite in the Database. The following SQL statement can be executed to create an overwrite that disallows users without ManageGuild permission to run the -config command.

INSERT INTO "public"."command_permission_overwrites" ("guild_id", "commands", "required_discord_permissions", "required_system_permissions", "required_roles", "required_users", "required_channels", "required_level", "disabled", "on_match") 
VALUES ('<guild_id>', '{"config"}', '["ManageGuild"]', 'null', 'null', 'null', 'null', null, 'false', 'Allow');

Run this for every server the bot is in, and replace <guild_id> with the appropriate Guild ID each time.

References

Please join our Discord Server if you have questions.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:H

CVE ID

CVE-2024-45307

Credits