Packages / mongoose / Security

CriticalVulnerabilityGHSA-8687-vv9j-hgphCVE-2019-17426Published 22 Oct 2019

Improper Input Validation in Automattic Mongoose

Your version

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.5
Every release on a timeline
9.x
  1. Not affected

    9.0.0 – 9.11.4

    49 releases, latest

5.x
  1. Affected

    5.0.0 – 5.7.4

    122 releases

  2. Fixed

    5.7.5 – 5.13.23

    133 releases

4.x
  1. Affected

    4.0.0 – 4.13.20

    163 releases

  2. Fixed

    4.13.21

    1 release

3.x
  1. Affected

    3.0.0 – 3.9.7

    104 releases

2.x
  1. Affected

    2.0.0 – 2.9.10

    84 releases

1.x
  1. Affected

    1.0.0 – 1.8.4

    64 releases

0.x
  1. Affected

    0.0.1 – 0.0.6

    6 releases

1016 stable releases of mongoose, oldest to newest, one row per major.

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).