CVE-2021-21414: @prisma/sdk Command Injection Vulnerability Vulnerability
HIGHCVE-2021-21414 is a HIGH (CVSS 7.7) command injection vulnerability vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting @prisma/sdk libraries in the npm ecosystem. The issue involves command injection vulnerability in @prisma/sdk in getpackedpackage function. Remediation is available by upgrading affected packages to version 2.20.0.
CVE-2021-21414 at a Glance
Security Impact
CVSS: 7.7
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:N).
How to Fix CVE-2021-21414
To remediate this vulnerability, upgrade all affected @prisma/sdk 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 @prisma/sdk@2.20.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @prisma/sdk
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-21414, inspect your project dependencies using npm:
npm ls @prisma/sdk
Analyze the terminal output to locate any version of @prisma/sdk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.20.0), your application is affected.
Note: The npm ls @prisma/sdk 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 @prisma/sdk, 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-21414 Affected @prisma/sdk Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@prisma/sdk
|
npm |
< 2.20.0
|
2.20.0
|
References
Frequently Asked Questions
What is CVE-2021-21414?
Which @prisma/sdk versions are affected?
What version fixes CVE-2021-21414?
Is @prisma/sdk affected?
What is the CVSS score of CVE-2021-21414?
What CWE is associated with CVE-2021-21414?
How can I check npm dependencies for CVE-2021-21414?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pxcc-hj8w-fmm7",
"modified" : "2021-03-31T18:00:32Z",
"published" : "2021-04-06T17:25:12Z",
"aliases" : [ "CVE-2021-21414" ],
"summary" : "Command injection vulnerability in @prisma/sdk in getPackedPackage function",
"details" : "### Impact\n\nAs of today, we are not aware of any Prisma users or external consumers of the `@prisma/sdk` package who are affected by this security vulnerability.\n\nThis issue may lead to remote code execution if a client of the library calls the vulnerable method with untrusted input.\n\nIt only affects the `getPackedPackage` function and this function is not advertised and only used for tests & building our CLI, no malicious code was found after checking our codebase.\n\n### Patches\n\nFixed in \n- @prisma/sdk@2.20.0 (latest channel)\n- @prisma/sdk@2.20.0-dev.29 (dev channel)\n\nPull Request closing this vulnerability [https://github.com/prisma/prisma/pull/6245](https://github.com/prisma/prisma/pull/6245)\n\n### Acknowledgements\n\nThis issue was discovered and reported by GitHub Engineer [@erik-krogh (Erik Krogh Kristensen)](https://github.com/erik-krogh).\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n- Create a discussion in [the Prisma repository](https://github.com/prisma/prisma/discussions)\n- Email us at security@prisma.io",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@prisma/sdk"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.20.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/prisma/prisma/security/advisories/GHSA-pxcc-hj8w-fmm7"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-21414"
}, {
"type" : "WEB",
"url" : "https://github.com/prisma/prisma/pull/6245"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20210618-0003"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-78" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-03-31T18:00:32Z",
"nvd_published_at" : "2021-04-29T01:15:00Z"
}
}