Summary
A vulnerability (CWE-915) in the association handling of the Mongoid ODM library allows structured input supplied in place of a simple identifier value to be turned into an object treated as an already-stored record of an attacker-chosen model class. Affected versions are 9.1.0 up to, but not including, 9.1.3.
Per the CVSS vector (score 8.2, high), the attack is network-based, low complexity, requires no authentication and no user interaction. The precondition is that the application passes unfiltered request data into the affected association handling (belongs_to).
An attacker may cause unintended modification or deletion of stored records (high integrity impact) and render an individual record unreadable through that association (low availability impact). There is no confidentiality impact. The vulnerability is not listed in the CISA KEV catalog.
Who is affected
Organizations developing or running Ruby applications using Mongoid 9.1.0 up to before 9.1.3, especially those assigning HTTP request data directly to belongs_to associations.
What to do
- Upgrade Mongoid to version 9.1.3 or later.
- Check Gemfile.lock (e.g. bundle list | grep mongoid) to identify the version used across all applications.
- Review code where request parameters are passed into belongs_to associations and enforce filtering (e.g. strong parameters) so only scalar identifiers are accepted.
- Follow the vendor's official advisory (https://jira.mongodb.org/browse/MONGOID-5969) for further details.
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:L
- 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
- Low impact
Weakness type (CWE)
- CWE-915 Improperly Controlled Modification of Dynamically-Determined Object Attributes
References
Sources: CVE.org (CNA and CISA ADP), CISA KEV, FIRST EPSS. Always check the vendor's official advisory.