Vulnerabilities in pkg:npm/dynamoose
PACKAGECVE-2021-21304 is a HIGH (CVSS 7.2) prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Dynamoose libraries in the npm ecosystem. The issue involves prototype pollution in dynamoose. Remediation is available by upgrading affected packages to version 2.7.0.
pkg:npm/dynamoose
Vulnerability advisories affecting package pkg:npm/dynamoose. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-rrqm-p222-8ph2 | CVE-2021-21304 | HIGH | Prototype Pollution in Dynamoose |
CVE-2021-21304 at a Glance
Security Impact
CVSS: 7.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N).
How to Fix CVE-2021-21304
To remediate this vulnerability, upgrade all affected Dynamoose 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 dynamoose@2.7.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls dynamoose
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-21304, inspect your project dependencies using npm:
npm ls dynamoose
Analyze the terminal output to locate any version of Dynamoose in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.7.0), your application is affected.
Note: The npm ls dynamoose 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-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In Dynamoose, 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-21304 Affected Dynamoose Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
dynamoose
|
npm |
≥ 2.0.0
< 2.7.0
|
2.7.0
|
References
Frequently Asked Questions
What is CVE-2021-21304?
Which Dynamoose versions are affected?
What version fixes CVE-2021-21304?
Is dynamoose affected?
What is the CVSS score of CVE-2021-21304?
What CWE is associated with CVE-2021-21304?
How can I check npm dependencies for CVE-2021-21304?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-rrqm-p222-8ph2",
"modified" : "2022-05-26T19:58:25Z",
"published" : "2021-02-08T17:44:01Z",
"aliases" : [ "CVE-2021-21304" ],
"summary" : "Prototype Pollution in Dynamoose",
"details" : "### Impact\n\nIn Dynamoose versions 2.0.0-2.6.0 there was a prototype pollution vulnerability in the internal utility method [`lib/utils/object/set.ts`](https://github.com/dynamoose/dynamoose/blob/master/lib/utils/object/set.ts). This method is used throughout the codebase for various operations throughout Dynamoose.\n\nWe have not seen any evidence of this vulnerability being exploited.\n\nWe do not believe this issue impacts v1.x.x since this method was added as part of the v2 rewrite. This vulnerability also impacts v2.x.x beta/alpha versions.\n\n### Patches\n\nv2.7.0 includes a patch for this vulnerability.\n\n### Workarounds\n\nWe are unaware of any workarounds to patch this vulnerability other than upgrading to v2.7.0 or greater.\n\n### References\n\n- Patch commit hash: 324c62b4709204955931a187362f8999805b1d8e\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* [Contact me](https://charlie.fish/contact)\n* [Read our Security Policy](https://github.com/dynamoose/dynamoose/blob/master/SECURITY.md)\n\n### Credit\n\n- GitHub CodeQL Code Scanning",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "dynamoose"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0"
}, {
"fixed" : "2.7.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/dynamoose/dynamoose/security/advisories/GHSA-rrqm-p222-8ph2"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-21304"
}, {
"type" : "WEB",
"url" : "https://github.com/dynamoose/dynamoose/commit/324c62b4709204955931a187362f8999805b1d8e"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/dynamoose/dynamoose"
}, {
"type" : "WEB",
"url" : "https://github.com/dynamoose/dynamoose/releases/tag/v2.7.0"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/package/dynamoose"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1321", "CWE-915" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-02-08T17:43:18Z",
"nvd_published_at" : "2021-02-08T18:15:00Z"
}
}