296,663
Total vulnerabilities in the database
A logic flaw exists in the message command handler of CommandKit that affects how the commandName
property is exposed to both middleware functions and command execution contexts when handling command aliases. When a message command is invoked using an alias, the ctx.commandName
value reflects the alias rather than the canonical command name. This occurs in both middleware functions and within the command’s own run function.
Developers who rely on ctx.commandName
for logic that assumes it represents the canonical command identifier may introduce unintended behavior. In security-sensitive cases, such as middleware used for permission checks, rate limiting, or audit logging, this behavior could allow unauthorized command execution or inaccurate access control decisions. Slash commands and context menu commands are not affected.
Fixed in v1.2.0-rc.12.
ctx.commandName
now consistently returns the actual command name, regardless of the alias used to invoke it.
If upgrading isn't immediately possible:
ctx.command.data.command.name
for permission validations, orSoftware | From | Fixed in |
---|---|---|
![]() |
1.2.0-rc.1 | 1.2.0-rc.12 |