PHP object injection via unsuppressible __pclass class inference in command monitoring events
Impact
Deserialization of untrusted data in the command monitoring support of the MongoDB PHP Driver can cause class names embedded in document content to be honored when the driver builds monitoring event objects. When an application registers a command monitoring subscriber and includes untrusted data in a database operation, an unauthenticated party who controls that data may cause an application class implementing the driver's persistable interface to be instantiated and its unserialization method invoked with the supplied data. The resulting impact depends on the classes available in the application.
Patches
Fixed in 1.21.10, 2.1.10, 2.5.3
Workarounds
Can check BSON does not contain __pclass fields.
References
https://jira.mongodb.org/browse/PHPC-2743
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| mongodb Product | < 1.21.10 | 1.21.10 |
| >= 2.0.0, < 2.1.10 | 2.1.10 | |
| >= 2.2.0, < 2.5.3 | 2.5.3 | |
| mongodb/mongodb-extension Product | < 1.21.10 | 1.21.10 |
| >= 2.0.0, < 2.1.10 | 2.1.10 | |
| >= 2.2.0, < 2.5.3 | 2.5.3 |
Details and references
- CVSS 4.0
- CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N
- Severity from
- GitHub (reviewed advisory)