{"id":"CVE-2025-62378","aliases":["CVE-2025-62378","GHSA-fhwm-pc6r-4h2f"],"related":[],"kind":"vulnerability","state":"published","title":"CommandKit exposes incorrect command name in context object for message command aliases","summary":"CommandKit is the discord.js meta-framework for building Discord bots. In versions 1.2.0-rc.1 through 1.2.0-rc.11, a logic flaw exists in the message command handler 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. Although not explicitly documented, CommandKit's examples and guidance around middleware usage implicitly convey that ctx.commandName represents the canonical command identifier. Middleware examples in the documentation consistently use ctx.commandName to reference the command being executed. Developers who assume ctx.commandName is canonical may introduce unintended behavior when relying on it for logic such as permission checks, rate limiting, or audit logging. This could allow unauthorized command execution or inaccurate access control decisions. Slash commands and context menu commands are not affected. This issue has been patched in version 1.2.0-rc.12, where ctx.commandName now consistently returns the actual canonical command name regardless of the alias used to invoke it.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"CommandKit is the discord.js meta-framework for building Discord bots. In versions 1.2.0-rc.1 through 1.2.0-rc.11, a logic flaw exists in the message command handler 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. Although not explicitly documented, CommandKit's examples and guidance around middleware usage implicitly convey that ctx.commandName represents the canonical command identifier. Middleware examples in the documentation consistently use ctx.commandName to reference the command being executed. Developers who assume ctx.commandName is canonical may introduce unintended behavior when relying on it for logic such as permission checks, rate limiting, or audit logging. This could allow unauthorized command execution or inaccurate access control decisions. Slash commands and context menu commands are not affected. This issue has been patched in version 1.2.0-rc.12, where ctx.commandName now consistently returns the actual canonical command name regardless of the alias used to invoke it.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nA 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.\n\nAlthough not explicitly documented, CommandKit’s examples and guidance around middleware usage implicitly convey that `ctx.commandName` represents the canonical command identifier. Middleware examples in the documentation consistently use `ctx.commandName` to reference the command being executed, and the documentation describes middleware as suitable for “logging, authentication, permission checks, or any other cross-cutting concerns.” As a result, developers reasonably expect `ctx.commandName` to return the canonical command name and may rely on it for security-sensitive logic.\n\nDevelopers who assume `ctx.commandName` is canonical may introduce unintended behavior when relying on it for logic such as permission checks, rate limiting, or audit logging. This could allow unauthorized command execution or inaccurate access control decisions. Slash commands and context menu commands are not affected.\n\n### Patches\n\nFixed in v1.2.0-rc.12.\n`ctx.commandName` now consistently returns the actual canonical command name, regardless of the alias used to invoke it.\n\n### Workaround\n\nIf upgrading isn't immediately possible:\n\n* Use `ctx.command.data.command.name` for permission validations, or\n* Include all command aliases in your permission logic.\n\n### References\n\n* [CommandKit repository](https://github.com/underctrl-io/commandkit)\n* [Middleware documentation](https://commandkit.dev/docs/guide/commands/middlewares)","format":"markdown","source":"ghsa"},{"lang":"es","text":"CommandKit es el meta-framework de discord.js para construir bots de Discord. En las versiones 1.2.0-rc.1 a 1.2.0-rc.11, existe una falla lógica en el gestor de comandos de mensajes que afecta cómo la propiedad commandName se expone tanto a las funciones middleware como a los contextos de ejecución de comandos al manejar alias de comandos. Cuando un comando de mensaje es invocado usando un alias, el valor ctx.commandName refleja el alias en lugar del nombre canónico del comando. Esto ocurre tanto en las funciones middleware como dentro de la propia función run del comando. Aunque no está explícitamente documentado, los ejemplos y la guía de CommandKit sobre el uso de middleware transmiten implícitamente que ctx.commandName representa el identificador canónico del comando. Los ejemplos de middleware en la documentación usan consistentemente ctx.commandName para referenciar el comando que se está ejecutando. Los desarrolladores que asumen que ctx.commandName es canónico pueden introducir un comportamiento no deseado al depender de él para lógica como verificaciones de permisos, limitación de velocidad o registro de auditoría. Esto podría permitir la ejecución no autorizada de comandos o decisiones imprecisas de control de acceso. Los comandos de barra y los comandos de menú contextual no se ven afectados. Este problema ha sido parcheado en la versión 1.2.0-rc.12, donde ctx.commandName ahora devuelve consistentemente el nombre canónico real del comando, independientemente del alias utilizado para invocarlo.","source":"nvd"}],"published":"2025-10-13T17:43:51.000Z","modified":"2026-10-08T11:10:00.250Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","score":6.1,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-706"],"affected":[{"ranges":[{"version":">= 1.2.0-rc.1 < 1.2.0-rc.12","status":"affected"}],"vendor":"underctrl-io","product":"commandkit","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"1.2.0-rc.1","status":"affected","fixed":"1.2.0-rc.12"}],"ecosystem":"npm","package":"commandkit","purl":"pkg:npm/commandkit","source":"ghsa"}],"references":[{"url":"https://github.com/underctrl-io/commandkit/security/advisories/GHSA-fhwm-pc6r-4h2f","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-62378","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/underctrl-io/commandkit/commit/440385a3e5de3fa3d2a76d23a807995cb29602fd","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/underctrl-io/commandkit","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-10-15T17:13:11.098Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-62378","url":"https://www.cve.org/CVERecord?id=CVE-2025-62378","licence":"CVE Terms of Use","modified":"2025-10-15T17:13:21.693Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-fhwm-pc6r-4h2f","url":"https://github.com/advisories/GHSA-fhwm-pc6r-4h2f","licence":"CC-BY-4.0","modified":"2025-10-16T07:57:35.833Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-62378","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-62378","licence":"Public domain","modified":"2026-10-08T11:10:00.250Z"}],"updatedAt":"2026-11-25T22:59:06.465Z","epss":{"score":0.00168,"percentile":0.06342,"date":"2026-12-01T12:00:22.000Z"}}