Summary
A type-confusion weakness (CWE-843) in the Extended JSON parsing component of BSON for Ruby (MongoDB Ruby Driver) allows a party who can supply parser input to influence how a serialized document is framed. Content placed in one value may be read back as additional or replacement document fields.
Per the CVSS vector (7.5, high), the attack is network-based, low complexity, and requires no authentication or user interaction. The impact is on integrity: if an application parses untrusted Extended JSON and stores the result, an attacker may cause unintended modification of stored data. Confidentiality and availability are not affected. The vulnerability is not listed in the CISA KEV catalog.
Who is affected
Organizations using MongoDB Ruby Driver / BSON for Ruby versions 4.8.0 up to but not including 5.2.1 in applications that parse untrusted Extended JSON and store the result.
What to do
- Upgrade BSON for Ruby / MongoDB Ruby Driver to version 5.2.1 or later.
- Inventory applications (e.g. review Gemfile.lock) to identify use of affected versions 4.8.0 through before 5.2.1.
- Determine whether applications parse Extended JSON from untrusted sources (e.g. user input, API requests) and persist the result.
- Until upgraded, restrict or additionally validate untrusted Extended JSON input; follow the vendor advisory for details (https://jira.mongodb.org/browse/RUBY-3936).
Affected products and versions
CVSS vector, explained
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
- Attack vector
- Network (from the internet)
- Attack complexity
- Low
- Privileges required
- None (no login)
- User interaction
- Not required
- Scope
- Vulnerable component only
- Confidentiality
- None
- Integrity
- High impact
- Availability
- None
Weakness type (CWE)
- CWE-843 Access of Resource Using Incompatible Type ('Type Confusion')
References
Sources: CVE.org (CNA and CISA ADP), CISA KEV, FIRST EPSS. Always check the vendor's official advisory.