Packages / mongoose / Security
Improper Input Validation in Automattic Mongoose
Affected releases · mongoose
- 5.x5.0.0 – 5.7.4Fixed in 5.7.5
- 4.x4.0.0 – 4.13.20Fixed in 4.13.21
- 3.x and older0.0.1 – 3.9.7No fix, no longer updated
On 5.x, the newest line:
npm install mongoose@5.7.5Every release on a timeline
Not affected
9.0.0 – 9.11.4
49 releases, latest
Affected
5.0.0 – 5.7.4
122 releases
Fixed
5.7.5 – 5.13.23
133 releases
Affected
4.0.0 – 4.13.20
163 releases
Fixed
4.13.21
1 release
Affected
3.0.0 – 3.9.7
104 releases
Affected
2.0.0 – 2.9.10
84 releases
Affected
1.0.0 – 1.8.4
64 releases
Affected
0.0.1 – 0.0.6
6 releases
What happens
Automattic Mongoose through 5.7.4 allows attackers to bypass access control (in some applications) because any query object with a _bsontype attribute is ignored. For example, adding "_bsontype":"a" can sometimes interfere with a query filter. NOTE: this CVE is about Mongoose's failure to work around this _bsontype special case that exists in older versions of the bson parser (aka the mongodb/js-bson project).