Vulnerabilities in pkg:npm/@zowe/imperative

PACKAGE
Advisory Identifier: GHSA-6q8m-42qq-64r7
Advisory Summary

CVE-2021-4326 is a LOW (CVSS 3.3) imperative cli vulnerable to command vulnerability (CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')) affecting @zowe/imperative libraries in the npm ecosystem. The issue involves imperative cli vulnerable to command injection. Remediation is available by upgrading affected packages to version 5.7.1, 4.18.10.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@zowe/imperative

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-6q8m-42qq-64r7 CVE-2021-4326 LOW Imperative CLI vulnerable to Command Injection

CVE-2021-4326 at a Glance

CVE Identifier CVE-2021-4326
GHSA Identifier GHSA-6q8m-42qq-64r7
Severity LOW
CVSS v3.1 Base Score 3.3
CWE Classification CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')
Affected Product @zowe/imperative
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 3.3

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:N/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 None (I:N)
Availability None (A:N)

How to Fix CVE-2021-4326

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

@zowe/imperative fixed: 5.7.1
npm install @zowe/imperative@5.7.1
@zowe/imperative fixed: 4.18.10
npm install @zowe/imperative@4.18.10
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 @zowe/imperative

How to Check if You Are Affected

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

npm ls @zowe/imperative

Analyze the terminal output to locate any version of @zowe/imperative in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.7.1), your application is affected.

Note: The npm ls @zowe/imperative 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-77: Improper Neutralization of Special Elements used in a Command ('Command Injection'), where the product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. In @zowe/imperative, 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

A vulnerability in Imperative framework which allows already-privileged local actors to execute arbitrary shell commands via plugin install/update commands, or maliciously formed environment variables. Impacts Zowe CLI.

CVE-2021-4326 Affected @zowe/imperative Versions

2 component(s)
Fixed Versions:
5.7.14.18.10
Product / Package Ecosystem Affected Versions Fixed Version
@zowe/imperative
npm
≥ 5.0.0
< 5.7.1
5.7.1
@zowe/imperative
npm
< 4.18.10
4.18.10

References

Frequently Asked Questions

What is CVE-2021-4326?
CVE-2021-4326 is a security vulnerability in @zowe/imperative involving Imperative CLI vulnerable to Command Injection under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection').
Which @zowe/imperative versions are affected?
Affected versions include releases prior to 5.7.1, 4.18.10 across affected packages: @zowe/imperative.
What version fixes CVE-2021-4326?
Upgrading to 5.7.1, 4.18.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @zowe/imperative affected?
Yes, @zowe/imperative is affected in releases prior to 5.7.1, 4.18.10. Upgrade your dependency to 5.7.1, 4.18.10 or later.
What is the CVSS score of CVE-2021-4326?
CVE-2021-4326 has a CVSS v3.1 base score of 3.3 (LOW) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2021-4326?
CVE-2021-4326 is classified under CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') (The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.).
How can I check npm dependencies for CVE-2021-4326?
Run the dependency tree command: 'npm ls @zowe/imperative'. 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-6q8m-42qq-64r7",
  "modified" : "2023-03-02T17:16:46Z",
  "published" : "2023-03-01T09:30:29Z",
  "aliases" : [ "CVE-2021-4326" ],
  "summary" : "Imperative CLI vulnerable to Command Injection",
  "details" : "A vulnerability in Imperative framework which allows already-privileged local actors to execute arbitrary shell commands via plugin install/update commands, or maliciously formed environment variables. Impacts Zowe CLI.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@zowe/imperative"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.7.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@zowe/imperative"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.18.10"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-4326"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zowe/imperative/pull/900"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zowe/imperative/pull/902"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zowe/imperative"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zowe/imperative/commits/v4.18.10"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zowe/imperative/commits/v5.7.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-77" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-03-01T22:57:51Z",
    "nvd_published_at" : "2023-03-01T08:15:00Z"
  }
}