Vulnerabilities in pkg:npm/commandkit

PACKAGE
Advisory Identifier: GHSA-fhwm-pc6r-4h2f
Advisory Summary

CVE-2025-62378 is a MODERATE (CVSS 6.1) commandkit has incorrect command name vulnerability (CWE-706: Use of Incorrectly-Resolved Name or Reference) affecting Commandkit libraries in the npm ecosystem. The issue involves commandkit has incorrect command name exposure in context object for message command aliases. Remediation is available by upgrading affected packages to version 1.2.0-rc.12.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/commandkit

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/commandkit. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-fhwm-pc6r-4h2f CVE-2025-62378 MODERATE CommandKit has incorrect command name exposure in context object for message command aliases

CVE-2025-62378 at a Glance

CVE Identifier CVE-2025-62378
GHSA Identifier GHSA-fhwm-pc6r-4h2f
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-706: Use of Incorrectly-Resolved Name or Reference
Affected Product Commandkit
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2025-62378

To remediate this vulnerability, upgrade all affected Commandkit dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

commandkit fixed: 1.2.0-rc.12
npm install commandkit@1.2.0-rc.12
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls commandkit

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-62378, inspect your project dependencies using npm:

npm ls commandkit

Analyze the terminal output to locate any version of Commandkit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.0-rc.12), your application is affected.

Note: The npm ls commandkit command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-706: Use of Incorrectly-Resolved Name or Reference, where 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. In Commandkit, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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. 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, 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. 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. ### Patches Fixed in v1.2.0-rc.12. `ctx.commandName` now consistently returns the actual canonical 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 * [CommandKit repository](https://github.com/underctrl-io/commandkit) * [Middleware documentation](https://commandkit.dev/docs/guide/commands/middlewares)

CVE-2025-62378 Affected Commandkit Versions

1 component(s)
Fixed Versions:
1.2.0-rc.12
Product / Package Ecosystem Affected Versions Fixed Version
commandkit
npm
≥ 1.2.0-rc.1
< 1.2.0-rc.12
1.2.0-rc.12

References

Frequently Asked Questions

What is CVE-2025-62378?
CVE-2025-62378 is a security vulnerability in Commandkit involving CommandKit has incorrect command name exposure in context object for message command aliases under CWE-706: Use of Incorrectly-Resolved Name or Reference.
Which Commandkit versions are affected?
Affected versions include releases prior to 1.2.0-rc.12 across affected packages: commandkit.
What version fixes CVE-2025-62378?
Upgrading to 1.2.0-rc.12 (or the latest patched release for your respective branch) resolves the vulnerability.
Is commandkit affected?
Yes, commandkit is affected in releases prior to 1.2.0-rc.12. Upgrade your dependency to 1.2.0-rc.12 or later.
What is the CVSS score of CVE-2025-62378?
CVE-2025-62378 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N.
What CWE is associated with CVE-2025-62378?
CVE-2025-62378 is classified under CWE-706: 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.).
How can I check npm dependencies for CVE-2025-62378?
Run the dependency tree command: 'npm ls commandkit'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-fhwm-pc6r-4h2f",
  "modified" : "2025-10-15T19:14:41Z",
  "published" : "2025-10-13T17:43:51Z",
  "aliases" : [ "CVE-2025-62378" ],
  "summary" : "CommandKit has incorrect command name exposure in context object for message command aliases",
  "details" : "### 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)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "commandkit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.0-rc.1"
      }, {
        "fixed" : "1.2.0-rc.12"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.2.0-rc.11"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/underctrl-io/commandkit/security/advisories/GHSA-fhwm-pc6r-4h2f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-62378"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/underctrl-io/commandkit/commit/440385a3e5de3fa3d2a76d23a807995cb29602fd"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/underctrl-io/commandkit"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-706" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-10-13T17:43:51Z",
    "nvd_published_at" : "2025-10-15T17:16:00Z"
  }
}