Skip to content

CommandKit has incorrect command name exposure in context object for message command aliases

Moderate severity GitHub Reviewed Published Oct 11, 2025 in underctrl-io/commandkit • Updated Oct 13, 2025

Package

npm commandkit (npm)

Affected versions

>= 1.2.0-rc.1, <= 1.2.0-rc.11

Patched versions

1.2.0-rc.12

Description

Impact

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.

Patches

Fixed in v1.2.0-rc.12.
ctx.commandName now consistently returns the actual command name, regardless of the alias used to invoke it.

Workaround

If upgrading isn't immediately possible:

  • Use ctx.command.data.command.name for permission validations, or
  • Include all command aliases in your permission logic.

References

References

@twlite twlite published to underctrl-io/commandkit Oct 11, 2025
Published to the GitHub Advisory Database Oct 13, 2025
Reviewed Oct 13, 2025
Last updated Oct 13, 2025

Severity

Moderate

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
Local
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
High
Availability
None

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:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N

EPSS score

Weaknesses

Use of Incorrectly-Resolved Name or Reference

The product uses a name or reference to access a resource, but the name/reference resolves to a resource that is outside of the intended control sphere. Learn more on MITRE.

CVE ID

No known CVE

GHSA ID

GHSA-fhwm-pc6r-4h2f

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.