CVE-2021-32830: @diez/generation Command Injection Vulnerability
LOWCVE-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.
CVE-2021-32830 at a Glance
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).
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.
npm install @diez/generation@Latest secure release
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
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?
Which @diez/generation versions are affected?
What version fixes CVE-2021-32830?
Is @diez/generation affected?
What is the CVSS score of CVE-2021-32830?
What CWE is associated with CVE-2021-32830?
How can I check npm dependencies for CVE-2021-32830?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}