CVE-2018-13863: Bson Denial of Service Vulnerability
HIGHCVE-2018-13863 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Bson libraries in the npm ecosystem. The issue involves js-bson vulnerable to redos. Remediation is available by upgrading affected packages to version 1.0.5.
CVE-2018-13863 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2018-13863
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.0.5
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-2018-13863, 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.0.5), 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. 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-2018-13863 Affected Bson Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
bson
|
npm |
≥ 0.5.0
< 1.0.5
|
1.0.5
|
References
Frequently Asked Questions
What is CVE-2018-13863?
Which Bson versions are affected?
What version fixes CVE-2018-13863?
Is bson affected?
What is the CVSS score of CVE-2018-13863?
What CWE is associated with CVE-2018-13863?
How can I check npm dependencies for CVE-2018-13863?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8462-q7x7-g2x4",
"modified" : "2023-09-05T23:09:22Z",
"published" : "2018-09-17T20:44:58Z",
"aliases" : [ "CVE-2018-13863" ],
"summary" : "js-bson vulnerable to REDoS",
"details" : "The MongoDB bson JavaScript module (also known as js-bson) versions 0.5.0 to 1.0.x before 1.0.5 is vulnerable to a Regular Expression Denial of Service (ReDoS) in lib/bson/decimal128.js. The flaw is triggered when the Decimal128.fromString() function is called to parse a long untrusted string.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "bson"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.5.0"
}, {
"fixed" : "1.0.5"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-13863"
}, {
"type" : "WEB",
"url" : "https://github.com/mongodb/js-bson/commit/bd61c45157c53a1698ff23770160cf4783e9ea4a"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-8462-q7x7-g2x4"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mongodb/js-bson"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/npm:bson:20180225"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-185", "CWE-400" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T21:24:09Z",
"nvd_published_at" : null
}
}