Vulnerabilities in pkg:npm/@diez/generation

PACKAGE
Advisory Identifier: GHSA-8c3f-x5f9-6h62
Advisory Summary

CVE-2021-32830 is a LOW (CVSS 3.9) command injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting @diez/generation libraries in the npm ecosystem. The issue involves command injection in @diez/generation. Remediation is available in the latest vendor maintenance releases.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@diez/generation

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-8c3f-x5f9-6h62 CVE-2021-32830 LOW Command injection in @diez/generation

CVE-2021-32830 at a Glance

CVE Identifier CVE-2021-32830
GHSA Identifier GHSA-8c3f-x5f9-6h62
Severity LOW
CVSS v3.1 Base Score 3.9
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product @diez/generation
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 3.9

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

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

How to Fix CVE-2021-32830

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

@diez/generation fixed: Latest secure release
npm install @diez/generation@Latest secure release
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 @diez/generation

How to Check if You Are Affected

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

npm ls @diez/generation

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

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

The `@diez/generation` npm package is a client for Diez. The locateFont method of @diez/generation has a command injection vulnerability. Clients of the @diez/generation library are unlikely to be aware of this, so they might unwittingly write code that contains a vulnerability. This issue may lead to remote code execution if a client of the library calls the vulnerable method with untrusted input. All versions of this package are vulnerable as of the writing of this CVE.

CVE-2021-32830 Affected @diez/generation Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
@diez/generation
npm
≤ 10.6.0

References

Frequently Asked Questions

What is CVE-2021-32830?
CVE-2021-32830 is a security vulnerability in @diez/generation involving Command injection in @diez/generation under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which @diez/generation versions are affected?
Affected versions include releases prior to current release patches across affected packages: @diez/generation.
What version fixes CVE-2021-32830?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is @diez/generation affected?
Yes, @diez/generation is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2021-32830?
CVE-2021-32830 has a CVSS v3.1 base score of 3.9 (LOW) with vector string CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2021-32830?
CVE-2021-32830 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check npm dependencies for CVE-2021-32830?
Run the dependency tree command: 'npm ls @diez/generation'. 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-8c3f-x5f9-6h62",
  "modified" : "2021-08-26T14:39:22Z",
  "published" : "2021-09-02T17:08:20Z",
  "aliases" : [ "CVE-2021-32830" ],
  "summary" : "Command injection in @diez/generation",
  "details" : "The `@diez/generation` npm package is a client for Diez. The locateFont method of @diez/generation has a command injection vulnerability. Clients of the @diez/generation library are unlikely to be aware of this, so they might unwittingly write code that contains a vulnerability. This issue may lead to remote code execution if a client of the library calls the vulnerable method with untrusted input. All versions of this package are vulnerable as of the writing of this CVE.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@diez/generation"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "10.6.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-32830"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/diez/diez"
  }, {
    "type" : "ADVISORY",
    "url" : "https://securitylab.github.com/advisories/GHSL-2021-061-diez-generation-cmd-injection"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/@diez/generation"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-77", "CWE-78" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-08-19T20:09:43Z",
    "nvd_published_at" : "2021-08-17T18:15:00Z"
  }
}