Skip to content
High 8.2

Mongooseに組み込み関数を上書きされる脆弱性、後続のクエリが失敗するおそれ

CVE-2026-125117 First seen on SecPulse

Summary

Mongooseには、攻撃者が制御するキーによって共有の組み込み関数やスキーマの状態を書き換えられる脆弱性(CVE-2026-125117)があります。書き換えられると、プロセスを再起動するまで無関係なモデルへのクエリが失敗するおそれがあり、CVSSは8.2です。影響するのは6.13.12より前の6系、7.8.13より前の7系、8.24.7より前の8系、9.11.4より前の9系で、6.13.12、7.8.13、8.24.7、9.11.4で修正されています。修正版への更新をお勧めします。

AI summary

Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.

Mongooseには、攻撃者が制御するキーによって共有の組み込み関数やスキーマの状態を書き換えられる脆弱性(CVE-2026-125117)があります。書き換えられると、プロセスを再起動するまで無関係なモデルへのクエリが失敗するおそれがあり、CVSSは8.2です。影響するのは6.13.12より前の6系、7.8.13より前の7系、8.24.7より前の8系、9.11.4より前の9系で、6.13.12、7.8.13、8.24.7、9.11.4で修正されています。修正版への更新をお勧めします。

Affected packages

PackageAffected → Fixed
Automatticmongoose —
npmmongoose
≥ 9.0.0, < 9.11.4→ 9.11.4
Bitnamimongoose
< 6.13.12→ 6.13.12
≥ 7.0.0, < 7.8.13→ 7.8.13
≥ 8.0.0, < 8.24.7→ 8.24.7
≥ 9.0.0, < 9.11.4→ 9.11.4
Original description The description as published by the source.

Summary

Three Mongoose code paths copy data into objects by property name without checking whether the property is the object's own or inherited from its prototype:

  1. Loading a document from the database (init(), also used by Model.hydrate())
  2. Setting a dotted path on a document ($__set, used by new Model(obj), doc.set() and doc.$set())
  3. Merging update documents (utils.mergeClone, used by findOneAndReplace(), chained update calls and Query.prototype.merge())

When a key names an inherited property, such as toString or valueOf, or a document internal such as $__schema, Mongoose writes into the shared object behind that property. The data comes from the attacker.

  • Denial of service. For example, { "toString": { "call": 1 } } overwrites Object.prototype.toString.call. Mongoose and most other libraries rely on Object.prototype.toString.call(). After the overwrite, every later query in the process throws TypeError: _toString.call is not a function until the process restarts. This includes queries on unrelated models.
  • Changing shared schema state. Through a subdocument with strict: false, a path such as profile.$__schema.paths.email.validators reaches the subdocument's schema, which every document shares. Setting it to [] removes the required validator for every document in the process.

Mongoose already blocked __proto__, constructor and prototype, so these bugs cannot add properties to Object.prototype itself.…

Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details