[SERVER-35247] Undefined is allowed for required fields in IDL Created: 25/May/18  Updated: 29/Oct/23  Resolved: 29/Aug/18

Status: Closed
Project: Core Server
Component/s: IDL
Affects Version/s: None
Fix Version/s: 4.1.3

Type: Bug Priority: Major - P3
Reporter: Siyuan Zhou Assignee: Mark Benvenuto
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File parsing.patch    
Issue Links:
Depends
Problem/Incident
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Security 2018-09-10
Participants:
Linked BF Score: 41

 Description   

Parsing OplogEntry with Undefined "o" field is accepted, but serialization of OplogEntry crashes on that. ReplOperation parsing and serialization don't crash but return an empty Object for the "o" field. Unit test patch is attached. Running ./build/ninja/mongo/db/repl/oplog_test --suite OplogParsing after compile will reproduce the issue.



 Comments   
Comment by Githook User [ 29/Aug/18 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-35247 Undefined is allowed for required fields in IDL
Branch: master
https://github.com/mongodb/mongo/commit/1e83ae5db6a9be04fa714d57b2068f79f519af32

Comment by Janna Golden [ 17/Aug/18 ]

killSessions will accept `undefined`:

db.adminCommand({killSessions: [{id: undefined}]})

will return

{"ok":1}

Comment by Kyle Suarez [ 27/Jul/18 ]

The parsing for the new $out relies on the IDL rejecting values like this for our "mode" enumeration. Otherwise, we hit a MONGO_UNREACHABLE in this code.

Generated at Thu Feb 08 04:39:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.