[SERVER-68901] Incorrect $elemMatch query analysis in mongocryptd if document contains 2 different fields with the same name Created: 17/Aug/22  Updated: 29/Oct/23  Resolved: 02/Sep/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 6.0.0
Fix Version/s: 6.1.1, 4.2.24, 4.4.19, 5.0.15, 6.0.4

Type: Bug Priority: Major - P3
Reporter: Dmitry Lukyanov (Inactive) Assignee: Davis Haupt (Inactive)
Resolution: Fixed Votes: 0
Labels: csfle
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
related to SERVER-69377 Support $elemMatch in query analysis Open
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.1, v6.0, v5.0, v4.4, v4.2
Steps To Reproduce:

Repros:

Sprint: QO 2022-09-05
Participants:

 Description   

mongocryptd $elemMatch analysis encrypts field that is not mentioned in schemaMap. This happens if a document contains 2 different fields with the same name. If one of this field is mentioned in schemaMap, $elemMatch query analysis will encrypt both of them during filter creating.



 Comments   
Comment by Githook User [ 16/Nov/22 ]

Author:

{'name': 'Davis Haupt', 'email': 'davis.haupt@mongodb.com', 'username': 'davish'}

Message: SERVER-68901 ignore expressions under $elemMatch in query analysis
Branch: v4.2
https://github.com/10gen/mongo-enterprise-modules/commit/9b0a34d9cb642fa8363410702f58fa9075b59b27

Comment by Githook User [ 16/Nov/22 ]

Author:

{'name': 'Davis Haupt', 'email': 'davis.haupt@mongodb.com', 'username': 'davish'}

Message: SERVER-68901 ignore expressions under $elemMatch in query analysis
Branch: v4.4
https://github.com/10gen/mongo-enterprise-modules/commit/6afabc9068521a56c58604840611e397141e4c19

Comment by Githook User [ 15/Nov/22 ]

Author:

{'name': 'Davis Haupt', 'email': 'davis.haupt@mongodb.com', 'username': 'davish'}

Message: SERVER-68901 ignore expressions under $elemMatch in query analysis
Branch: v5.0
https://github.com/10gen/mongo-enterprise-modules/commit/75858005236d6970e0bc7860dd6d8bbd97e2a9a6

Comment by Githook User [ 15/Nov/22 ]

Author:

{'name': 'Davis Haupt', 'email': 'davis.haupt@mongodb.com', 'username': 'davish'}

Message: SERVER-68901 ignore expressions under $elemMatch in query analysis
Branch: v6.0
https://github.com/10gen/mongo-enterprise-modules/commit/cd3f83ebd59bada83557d5ddf461e586bfb54280

Comment by Githook User [ 15/Nov/22 ]

Author:

{'name': 'Davis Haupt', 'email': 'davis.haupt@mongodb.com', 'username': 'davish'}

Message: SERVER-68901 ignore expressions under $elemMatch in query analysis
Branch: v6.1
https://github.com/10gen/mongo-enterprise-modules/commit/38c6adbc7a49c2eed08b435e06529a93169fd4a1

Comment by Githook User [ 02/Sep/22 ]

Author:

{'name': 'Davis Haupt', 'email': 'davis.haupt@mongodb.com', 'username': 'davish'}

Message: SERVER-68901 ignore expressions under in query analysis
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/7c9ae4fceead32df5eccb56983c39a38bd723e80

Comment by Davis Haupt (Inactive) [ 01/Sep/22 ]

Also filed SERVER-69377 to properly handle $elemMatch when we support arrays in query analysis.

Comment by Davis Haupt (Inactive) [ 01/Sep/22 ]

Requesting backports to 4.2 since this will affect all previous versions of mongocryptd.

Comment by Nicholas Zolnierz [ 17/Aug/22 ]

FYI jacob.evans@mongodb.com

Generated at Thu Feb 08 06:12:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.