Skip to content

Conversation

@renovate
Copy link

@renovate renovate bot commented Dec 4, 2024

This PR contains the following updates:

Package Change Age Confidence
mongoose (source) ^5.7.5 -> ^6.13.6 age confidence

GitHub Vulnerability Alerts

CVE-2019-17426

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

CVE-2022-2564

Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. Affected versions of this package are vulnerable to Prototype Pollution. The Schema.path() function is vulnerable to prototype pollution when setting the schema object. This vulnerability allows modification of the Object prototype and could be manipulated into a Denial of Service (DoS) attack.

CVE-2023-3696

Prototype Pollution in GitHub repository automattic/mongoose prior to 7.3.3, 6.11.3, and 5.13.20.

CVE-2022-24304

Description

Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment.

Affected versions of this package are vulnerable to Prototype Pollution. The Schema.path() function is vulnerable to prototype pollution when setting the schema object. This vulnerability allows modification of the Object prototype and could be manipulated into a Denial of Service (DoS) attack.

Proof of Concept

// poc.js
const mongoose = require('mongoose');
const schema = new mongoose.Schema();

malicious_payload = '__proto__.toString'

schema.path(malicious_payload, [String])

x = {}
console.log(x.toString()) // crashed (Denial of service (DoS) attack)

Impact

This vulnerability can be manipulated to exploit other types of attacks, such as Denial of service (DoS), Remote Code Execution, or Property Injection.

CVE-2024-53900

Mongoose versions prior to 8.8.3, 7.8.3, and 6.13.5 are vulnerable to improper use of the $where operator. This vulnerability arises from the ability of the $where clause to execute arbitrary JavaScript code in MongoDB queries, potentially leading to code injection attacks and unauthorized access or manipulation of database data.

CVE-2025-23061

Mongoose versions prior to 8.9.5, 7.8.4, and 6.13.6 are vulnerable to improper use of the $where operator. This vulnerability arises from the ability of the $where clause to execute arbitrary JavaScript code in MongoDB queries, potentially leading to code injection attacks and unauthorized access or manipulation of database data.

NOTE: this issue exists because of an incomplete fix for CVE-2024-53900.


Release Notes

Automattic/mongoose (mongoose)

v6.13.6

Compare Source

===================

v6.13.5

Compare Source

===================

  • fix: disallow using $where in match

v6.13.4

Compare Source

===================

v6.13.3

Compare Source

===================

  • docs(migrating_to_6): document that Lodash _.isEmpty() with ObjectId() as a parameter returns true in Mongoose 6 #​11152

v6.13.2

Compare Source

===================

  • fix(document): make set() respect merge option on deeply nested objects #​14870 #​14878

v6.13.1

Compare Source

===================

v6.13.0

Compare Source

===================

  • feat(model): add throwOnValidationError option for opting into getting MongooseBulkWriteError if all valid operations succeed in bulkWrite() and insertMany() #​14599 #​14587 #​14572 #​13410

v6.12.9

Compare Source

===================

v6.12.8

Compare Source

===================

  • fix(document): handle virtuals that are stored as objects but getter returns string with toJSON #​14468 #​14446
  • fix(schematype): consistently set wasPopulated to object with value property rather than boolean #​14418
  • docs(model): add extra note about lean option for insertMany() skipping casting #​14415 #​14376

v6.12.7

Compare Source

===================

v6.12.6

Compare Source

===================

  • fix(collection): correctly handle buffer timeouts with find() #​14277
  • fix(document): allow calling push() with different $position arguments #​14254

v6.12.5

Compare Source

===================

  • perf(schema): remove unnecessary lookahead in numeric subpath check
  • fix(document): allow setting nested path to null #​14226
  • fix(document): avoid flattening dotted paths in mixed path underneath nested path #​14198 #​14178
  • fix: add ignoreAtomics option to isModified() for better backwards compatibility with Mongoose 5 #​14213

v6.12.4

Compare Source

===================

  • fix: upgrade mongodb driver -> 4.17.2
  • fix(document): avoid treating nested projection as inclusive when applying defaults #​14173 #​14115
  • fix: account for null values when assigning isNew property #​14172 #​13883

v6.12.3

Compare Source

===================

  • fix(ChangeStream): correctly handle hydrate option when using change stream as stream instead of iterator #​14052
  • fix(schema): fix dangling reference to virtual in tree after removeVirtual() #​14019 #​13085
  • fix(document): avoid unmarking modified on nested path if no initial value stored and already modified #​14053 #​14024
  • fix(document): consistently avoid marking subpaths of nested paths as modified #​14053 #​14022

v6.12.2

Compare Source

===================

v6.12.1

Compare Source

===================

v6.12.0

Compare Source

===================

  • feat: use mongodb driver v4.17.1
  • fix(model): make Model.bulkWrite() with empty array and ordered false not throw an error #​13664
  • fix(document): correctly handle inclusive/exclusive projections when applying subdocument defaults #​13763 #​13720

v6.11.6

Compare Source

===================

v6.11.5

Compare Source

===================

  • fix(schema): make Schema.prototype.clone() avoid creating different copies of subdocuments and single nested paths underneath single nested paths #​13671 #​13626
  • fix: custom debug function not processing all args #​13418

v6.11.4

Compare Source

===================

  • perf: speed up mapOfSubdocs benchmark by 4x by avoiding unnecessary O(n^2) loop in getPathsToValidate() #​13614

v6.11.3

Compare Source

===================

  • fix: avoid prototype pollution on init
  • fix(schema): correctly handle uuids with populate() #​13317 #​13595

v6.11.2

Compare Source

===================

v6.11.1

Compare Source

===================

  • fix(query): apply schema-level paths before calculating projection for findOneAndUpdate() #​13348 #​13340
  • fix: add SUPPRESS_JEST_WARNINGS environment variable to hide jest warnings #​13384 #​13373
  • types(model): allow overwriting expected param type for bulkWrite() #​13292 hasezoey

v6.11.0

Compare Source

===================

v6.10.5

Compare Source

===================

  • perf(document): avoid unnecessary loops, conditionals, string manipulation on Document.prototype.get() for 10x speedup on top-level properties #​12953
  • fix(model): execute valid write operations if calling bulkWrite() with ordered: false #​13218 #​13176
  • fix(array): pass-through all parameters #​13202 #​13201 hasezoey
  • fix: improve error message when sorting by empty string #​13249 #​10182
  • docs: add version support and check version docs #​13251 #​13193

v6.10.4

Compare Source

===================

  • fix(document): apply setters on resulting value when calling Document.prototype.$inc() #​13178 #​13158
  • fix(model): add results property to unordered insertMany() to make it easy to identify exactly which documents were inserted #​13163 #​12791
  • docs(guide+schematypes): add UUID to schematypes guide #​13184

v6.10.3

Compare Source

===================

v6.10.2

Compare Source

===================

  • fix(document): avoid setting array default if document array projected out by sibling projection #​13135 #​13043 #​13003
  • fix(documentarray): set correct document array path if making map of document arrays #​13133
  • fix: undo accidental change to engines in package.json #​13124 lorand-horvath
  • docs: quick improvement to Model.init() docs #​13054

v6.10.1

Compare Source

===================

v6.10.0

Compare Source

===================

v6.9.3

Compare Source

==================

v6.9.2

Compare Source

==================

v6.9.1

Compare Source

==================

  • fix(document): isModified should not be triggered when setting a nested boolean to the same value as previously #​12994 lpizzinidev
  • fix(document): save newly set defaults underneath single nested subdocuments #​13002 #​12905
  • fix(update): handle custom discriminator model name when casting update #​12947 wassil
  • fix(connection): handles unique autoincrement ID for connections #​12990 lpizzinidev
  • fix(types): fix type of options of Model.aggregate #​12933 ghost91-
  • fix(types): fix "near" aggregation operator input type #​12954 Jokero
  • fix(types): add missing Top operator to AccumulatorOperator type declaration #​12952 lpizzinidev
  • docs(transactions): added example for Connection.transaction() method #​12943 #​12934 lpizzinidev
  • docs(populate): fix out of date comment referencing onModel property #​13000
  • docs(transactions): fix typo in transactions.md #​12995 Parth86

v6.9.0

Compare Source

==================

v6.8.4

Compare Source

==================

v6.8.3

Compare Source

==================

  • perf: improve performance of assignRawDocsToIdStructure for faster populate on large docs #​12867 Uzlopak
  • fix(model): ensure consistent ordering of validation errors in insertMany() with ordered: false and rawResult: true #​12866
  • fix: avoid passing final callback to pre hook, because calling the callback can mess up hook execution #​12836
  • fix(types): avoid inferring timestamps if methods, virtuals, or statics set #​12871
  • fix(types): correctly infer string enums on const arrays #​12870 JavaScriptBach
  • fix(types): allow virtuals to be invoked in the definition of other virtuals #​12874 sffc
  • fix(types): add type def for Aggregate#model without arguments #​12864 hasezoey
  • docs(discriminators): add section about changing discriminator key #​12861
  • docs(typescript): explain that virtuals inferred from schema only show up on Model, not raw document type #​12860 #​12684

v6.8.2

Compare Source

==================

  • fix(schema): propagate strictQuery to implicitly created schemas for embedded discriminators #​12827 #​12796
  • fix(model): respect discriminators with Model.validate() #​12824 #​12621
  • fix(query): fix unexpected validation error when doing findOneAndReplace() with a nullish value #​12826 #​12821
  • fix(discriminator): apply built-in plugins to discriminator schema even if mergeHooks and mergePlugins are both false #​12833 #​12696
  • fix(types): add option "overwriteModels" as a schema option #​12817 #​12816 hasezoey
  • fix(types): add property "defaultOptions" #​12818 hasezoey
  • docs: make search bar respect documentation version, so you can search 5.x docs #​12548
  • docs(typescript): make note about recommending strict mode when using auto typed schemas #​12825 #​12420
  • docs: add section on sorting to query docs #​12588 IslandRhythms
  • test(query.test): add write-concern option #​12829 hasezoey

v6.8.1

Compare Source

==================

v6.8.0

Compare Source

==================

v6.7.5

Compare Source

==================

v6.7.4

Compare Source

==================

v6.7.3

Compare Source

==================

v6.7.2

Compare Source

==================

v6.7.1

Compare Source

==================

v6.7.0

Compare Source

==================

  • feat: upgrade to mongodb driver 4.11.0 #​12446
  • feat: add UUID Schema Type (BSON Buffer SubType 4) #​12268 #​3208 hasezoey
  • feat(aggregation): add $fill pipeline stage #​12545 raphael-papazikas
  • feat(types+schema): allow defining schema paths using mongoose.Types.* to work around TS type inference issues #​12352
  • feat(schema): add alias() method that makes it easier to define multiple aliases for a given path #​12368
  • feat(model): add mergeHooks option to Model.discriminator() to avoid duplicate hooks #​12542
  • feat(document): add $timestamps() method to set timestamps for save(), bulkSave(), and insertMany() #​12540

v6.6.7

Compare Source

==================


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from 84c25fd to 58fe739 Compare December 5, 2024 06:46
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v8 [security] fix(deps): update dependency mongoose to v6 [security] Dec 5, 2024
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from 58fe739 to b010f61 Compare December 21, 2024 11:52
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v6 [security] fix(deps): update dependency mongoose to v8 [security] Dec 21, 2024
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from b010f61 to 393de0e Compare December 24, 2024 02:59
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v8 [security] fix(deps): update dependency mongoose to v6 [security] Dec 24, 2024
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from 393de0e to 95ba499 Compare January 15, 2025 03:34
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v6 [security] fix(deps): update dependency mongoose to v8 [security] Jan 15, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from 95ba499 to 395a6a4 Compare January 16, 2025 07:40
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v8 [security] fix(deps): update dependency mongoose to v6 [security] Jan 16, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from 395a6a4 to a256826 Compare January 17, 2025 03:11
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v6 [security] fix(deps): update dependency mongoose to v8 [security] Jan 17, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from a256826 to ead1599 Compare January 20, 2025 07:36
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v8 [security] fix(deps): update dependency mongoose to v6 [security] Jan 20, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from ead1599 to fc950bd Compare January 24, 2025 07:10
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v6 [security] fix(deps): update dependency mongoose to v8 [security] Jan 24, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from fc950bd to 7f0db77 Compare January 25, 2025 07:38
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v8 [security] fix(deps): update dependency mongoose to v6 [security] Jan 25, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from 7f0db77 to 49f06c9 Compare January 31, 2025 19:09
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v6 [security] fix(deps): update dependency mongoose to v8 [security] Jan 31, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from 49f06c9 to 9425742 Compare February 2, 2025 11:19
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v8 [security] fix(deps): update dependency mongoose to v6 [security] Feb 2, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from 9425742 to 29b323b Compare February 11, 2025 07:44
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v6 [security] fix(deps): update dependency mongoose to v8 [security] Feb 11, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from 29b323b to 48bd1b5 Compare February 15, 2025 03:59
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v8 [security] fix(deps): update dependency mongoose to v6 [security] Feb 15, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from 48bd1b5 to 55e6f15 Compare March 4, 2025 20:00
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v6 [security] fix(deps): update dependency mongoose to v8 [security] Mar 4, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from 55e6f15 to e629f76 Compare March 6, 2025 20:04
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v8 [security] fix(deps): update dependency mongoose to v6 [security] Mar 6, 2025
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v8 [security] fix(deps): update dependency mongoose to v6 [security] Jun 1, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from a9b13fa to ffeb9f2 Compare June 6, 2025 18:18
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v6 [security] fix(deps): update dependency mongoose to v8 [security] Jun 6, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from ffeb9f2 to d22b2cf Compare June 8, 2025 08:58
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v8 [security] fix(deps): update dependency mongoose to v6 [security] Jun 8, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from d22b2cf to 78f7c7f Compare June 22, 2025 07:54
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v6 [security] fix(deps): update dependency mongoose to v8 [security] Jun 22, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from 78f7c7f to 4b0cf37 Compare July 13, 2025 07:52
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v8 [security] fix(deps): update dependency mongoose to v6 [security] Jul 13, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from 4b0cf37 to 39c9e84 Compare August 11, 2025 08:10
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v6 [security] fix(deps): update dependency mongoose to v8 [security] Aug 11, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from 39c9e84 to c044eae Compare August 16, 2025 16:02
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v8 [security] fix(deps): update dependency mongoose to v6 [security] Aug 16, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from c044eae to da1c643 Compare August 21, 2025 03:58
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v6 [security] fix(deps): update dependency mongoose to v8 [security] Aug 21, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from da1c643 to 4670f58 Compare August 24, 2025 03:50
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v8 [security] fix(deps): update dependency mongoose to v6 [security] Aug 24, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from 4670f58 to bb85b25 Compare September 1, 2025 03:59
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v6 [security] fix(deps): update dependency mongoose to v8 [security] Sep 1, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from bb85b25 to 0efadb3 Compare September 2, 2025 03:43
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v8 [security] fix(deps): update dependency mongoose to v6 [security] Sep 2, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from 0efadb3 to b962420 Compare September 26, 2025 12:00
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v6 [security] fix(deps): update dependency mongoose to v8 [security] Sep 26, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from b962420 to 0e81dae Compare September 27, 2025 03:41
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v8 [security] fix(deps): update dependency mongoose to v6 [security] Sep 27, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from 0e81dae to d9cd423 Compare October 23, 2025 12:03
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v6 [security] fix(deps): update dependency mongoose to v8 [security] Oct 23, 2025
@renovate renovate bot force-pushed the renovate/npm-mongoose-vulnerability branch from d9cd423 to 87e9b6f Compare October 25, 2025 23:48
@renovate renovate bot changed the title fix(deps): update dependency mongoose to v8 [security] fix(deps): update dependency mongoose to v6 [security] Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants