CVE-2018-13863: Vulnerability in bson package

bson Updated 02 Oct 2025

Summary

17/09/2018
Yes i
High
7.5

CVE-2018-13863: js-bson vulnerable to REDoS. Affects bson versions >= 0.5.0, < 1.0.5. Fixed in 1.0.5. How to fix ↓

Also tracked for

The same CVE-2018-13863 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The bson package is a JavaScript module used by MongoDB for handling BSON (Binary JSON) data. It provides functions for parsing and manipulating BSON objects. The vulnerability affects versions 0.5.0 to 1.0.x before 1.0.5 of the bson package. The specific vulnerability lies in the lib/bson/decimal128.js file, where the Decimal128.fromString() function is susceptible to a Regular Expression Denial of Service (ReDoS) attack. This vulnerability can be exploited by passing a long untrusted string to the function.

Vulnerability Detail

The vulnerability in the bson package allows an attacker to trigger a Regular Expression Denial of Service (ReDoS) attack by exploiting the Decimal128.fromString() function. When this function is called with a long untrusted string, it can lead to excessive CPU usage and cause a denial of service. The impact of this vulnerability can be severe, as it can result in the unavailability of the affected system or service. The vulnerability has a CVSS score of 7.5, indicating a high severity level.

How To Fix

Latest published version: 7.3.3 as of 22 Oct 2026

npm install bson@7.3.3

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.0.5

This is the first release that contains the fix.

npm install bson@1.0.5

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is essential to update the bson package to the fixed version as soon as possible.

Conclusion

The bson package is vulnerable to a Regular Expression Denial of Service (ReDoS) attack in the Decimal128.fromString() function. This vulnerability can be fixed by updating the package to version 1.0.5 or later. It is recommended to apply the fix as soon as possible to mitigate the risk of a denial of service. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for bson →

Share this vulnerability

FAQ

The bson package is a JavaScript module used by MongoDB for handling BSON (Binary JSON) data. It provides functions for parsing and manipulating BSON objects.

The vulnerability is a Regular Expression Denial of Service (ReDoS) in the Decimal128.fromString() function of the bson package. It can be exploited by passing a long untrusted string to the function.

The vulnerability can lead to a denial of service by causing excessive CPU usage. It can result in the unavailability of the affected system or service.

To fix the vulnerability, update the bson package to version 1.0.5 or later by running the command: npm install bson@1.0.5

There is no known workaround for this vulnerability. It is crucial to update the bson package to the fixed version.

Related vulnerabilities

Recent vulnerabilities recorded for bson.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Latest published version: 7.3.3 as of 22 Oct 2026

npm install bson@7.3.3

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.0.5

This is the first release that contains the fix.

npm install bson@1.0.5

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback