GHSA-fhwm-pc6r-4h2f: CommandKit has incorrect command name exposure in context object for message command aliases
6.1
Basic Information
Technical Details
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
commandkit | npm | >= 1.2.0-rc.1, <= 1.2.0-rc.11 | 1.2.0-rc.12 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability exists because the commandName
property on the context object (ctx
) did not resolve command aliases to their canonical names for message-based commands. This could cause security controls, such as permission checks in middleware, to fail if they relied on the canonical command name. The analysis of the patch 440385a3e5de3fa3d2a76d23a807995cb29602fd
confirms this. The change in packages/commandkit/src/app/commands/Context.ts
modifies the commandName
getter to correctly resolve the command name. Previously, it returned the output of getCommand()
, which could be an alias. The fix introduces a call to resolveMessageCommandName
to ensure the canonical name is always returned. Therefore, the Context.commandName
getter is the vulnerable function, as it was the source of the incorrect command name that could be used to bypass security checks.
Vulnerable functions
Context.commandName
packages/commandkit/src/app/commands/Context.ts