GHSA-r5xw-q988-826m: Mongoose Remote Memory Exposure Vulnerability
MODERATEGHSA-r5xw-q988-826m is a MODERATE (CVSS 5.1) remote memory exposure vulnerability (CWE-201: Insertion of Sensitive Information Into Sent Data) affecting Mongoose libraries in the npm ecosystem. The issue involves remote memory exposure in mongoose. Remediation is available by upgrading affected packages to version 3.8.39, 4.3.6.
GHSA-r5xw-q988-826m at a Glance
Security Impact
CVSS: 5.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix GHSA-r5xw-q988-826m
To remediate this vulnerability, upgrade all affected Mongoose 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 mongoose@3.8.39
npm install mongoose@4.3.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls mongoose
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-r5xw-q988-826m, inspect your project dependencies using npm:
npm ls mongoose
Analyze the terminal output to locate any version of Mongoose in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.8.39), your application is affected.
Note: The npm ls mongoose 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-201: Insertion of Sensitive Information Into Sent Data, where the code transmits data to another actor, but a portion of the data includes sensitive information that should not be accessible to that actor. In Mongoose, 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
GHSA-r5xw-q988-826m Affected Mongoose Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mongoose
|
npm |
≥ 3.5.5
< 3.8.39
|
3.8.39
|
|
mongoose
|
npm |
≥ 4.0.0
< 4.3.6
|
4.3.6
|
References
Frequently Asked Questions
What is GHSA-r5xw-q988-826m?
Which Mongoose versions are affected?
What version fixes GHSA-r5xw-q988-826m?
Is mongoose affected?
What is the CVSS score of GHSA-r5xw-q988-826m?
What CWE is associated with GHSA-r5xw-q988-826m?
How can I check npm dependencies for GHSA-r5xw-q988-826m?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r5xw-q988-826m",
"modified" : "2023-12-07T22:05:28Z",
"published" : "2020-09-01T19:39:37Z",
"aliases" : [ ],
"summary" : "Remote Memory Exposure in mongoose",
"details" : "Versions of `mongoose` before 4.3.6, 3.8.39 are vulnerable to remote memory exposure.\n\nTrying to save a number to a field of type Buffer on the affected mongoose versions allocates a chunk of uninitialized memory and stores it in the database.\n\n\n## Recommendation\n\nUpdate to version 4.3.6, 3.8.39 or later.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "mongoose"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.5.5"
}, {
"fixed" : "3.8.39"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.8.38"
}
}, {
"package" : {
"ecosystem" : "npm",
"name" : "mongoose"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0.0"
}, {
"fixed" : "4.3.6"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 4.3.5"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/Automattic/mongoose/issues/3764"
}, {
"type" : "WEB",
"url" : "https://gist.github.com/ChALkeR/440bc3dfcbd9b6da75c3"
}, {
"type" : "WEB",
"url" : "https://gist.github.com/ChALkeR/d4a8055625221b6e65f0"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/599"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-201" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2020-08-31T18:29:22Z",
"nvd_published_at" : null
}
}