CVE-2022-2564: Mongoose prototype pollution in Schema.path

CVE-2022-2564 · Severity: low · CVSS 3.1 · Published 2022-07-29

Mongoose is a popular MongoDB object modeling library used to manage database interactions in Node.js applications. A prototype pollution vulnerability in the Schema.path() function could allow an attacker to modify core JavaScript object properties, potentially causing application crashes or unexpected behavior. This could impact availability of applications relying on affected Mongoose versions.

Technologies: mongoose (npm). Vendors: npm.

Quick answers

Is CVE-2022-2564 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2022-2564 being exploited in the wild.
How severe is CVE-2022-2564?
Low severity, with a CVSS score of 3.1, published 29 July 2022.
Which products and versions are affected?
mongoose (npm) SEMVER:introduced=6.0.0,fixed=6.4.6.
Is there a fix for CVE-2022-2564?
Yes. mongoose (npm): upgrade to 6.4.6 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2022-2564 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2022-2564?
Check whether you run mongoose (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • mongoose (npm): upgrade to 6.4.6 or later
    npm install mongoose@6.4.6

Technical details

The vulnerability is a prototype pollution flaw (CWE-1321) in Mongoose's Schema.path() function that fails to properly sanitize input when setting schema properties. An attacker with the ability to control schema path inputs can pollute the JavaScript Object prototype, leading to denial of service or other runtime complications. The attack requires network access to the application but no authentication. Affected versions include 6.0.0 through 6.4.5 and all versions prior to 5.13.15. Patches were released in versions 6.4.6 and 5.13.15.

Affected products

  • Automattic Mongoose 6.0.0 through 6.4.5, all versions before 5.13.15

Identifiers

  • CVE-2022-2564
  • GHSA-f825-f98c-gj3g

Timeline

  • 2022-07-29: disclosed
  • 2022-07-28: patched: Fixes released in versions 6.4.6 and 5.13.15

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.