CVE-2019-2391: Bson Deserialization Of Untrusted Data Vulnerability
MODERATECVE-2019-2391 is a MODERATE (CVSS 5.4) deserialization of untrusted data vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Bson libraries in the npm ecosystem. The issue involves deserialization of untrusted data in bson. Remediation is available by upgrading affected packages to version 1.1.4.
CVE-2019-2391 at a Glance
Security Impact
CVSS: 5.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N).
How to Fix CVE-2019-2391
To remediate this vulnerability, upgrade all affected Bson 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 bson@1.1.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls bson
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2019-2391, inspect your project dependencies using npm:
npm ls bson
Analyze the terminal output to locate any version of Bson in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.4), your application is affected.
Note: The npm ls bson 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-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Bson, 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-2019-2391 Affected Bson Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
bson
|
npm |
< 1.1.4
|
1.1.4
|
References
Frequently Asked Questions
What is CVE-2019-2391?
Which Bson versions are affected?
What version fixes CVE-2019-2391?
Is bson affected?
What is the CVSS score of CVE-2019-2391?
What CWE is associated with CVE-2019-2391?
How can I check npm dependencies for CVE-2019-2391?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4jwp-vfvf-657p",
"modified" : "2023-06-20T14:22:16Z",
"published" : "2022-02-10T23:30:20Z",
"aliases" : [ "CVE-2019-2391" ],
"summary" : "Deserialization of Untrusted Data in bson",
"details" : "Incorrect parsing of certain JSON input may result in js-bson not correctly serializing BSON. This may cause unexpected application behaviour including data disclosure.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "bson"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.1.4"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-2391"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mongodb/js-bson"
}, {
"type" : "WEB",
"url" : "https://github.com/mongodb/js-bson/releases/tag/v1.1.4"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-502" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-05-07T17:19:18Z",
"nvd_published_at" : "2020-03-31T14:15:00Z"
}
}