[SERVER-75575] Writing an invalid config.queryAnalyzers or config.mongos document causes the server to crash Created: 02/Apr/23  Updated: 29/Oct/23  Resolved: 03/Apr/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Cheahuychou Mao Assignee: Cheahuychou Mao
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding NYC 2023-04-17
Participants:

 Description   

The callback for onInsert, onUpdate and onDelete for the config.queryAnalyzers or config.mongos collections in the QueryAnalysisOpObserver all involve parsing the document BSONobj into the corresponding IDL types. If the document doesn't have the expected fields, the parser would thrown an error and cause the server to crash because onCommit() is noexcept. Users are unlikely to ever write to these internal collections but it is still important to prevent such issue from happening. That is, the document BSONObj should get parsed outside of the callback to make the write fail earlier with a uassert instead of later during commit time.



 Comments   
Comment by Githook User [ 03/Apr/23 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-75575 Make sure that writing invalid config.queryAnalyzers or config.mongos document fails peacefully
Branch: master
https://github.com/mongodb/mongo/commit/851cbe563937fbc6600120d917e22f5f1aef2dab

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