[SERVER-49334] IDL generated parsers do not validate that the input element is a BSON array for attributes of type array<type> Created: 07/Jul/20 Updated: 19/Oct/20 Resolved: 19/Oct/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | IDL |
| Affects Version/s: | 4.5 Desired |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Mindaugas Malinauskas | Assignee: | Garaudy Etienne |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL | ||||||||||
| Steps To Reproduce: |
|
||||||||||
| Participants: |
| Description |
|
IDL generated parsers do not validate that the input element is a BSON array for attributes of type array<type>. The parsers do accept both - BSON arrays and objects with array layout (please see Steps To Reproduce for an example). Expected behavior is that only BSON arrays are accepted. |
| Comments |
| Comment by Garaudy Etienne [ 19/Oct/20 ] |
|
mark.benvenuto Unless something bad happens here, we're not leaving this be. |
| Comment by Mark Benvenuto [ 14/Jul/20 ] |
|
I am not aware of anything going wrong because we allow array-like objects as arrays. |
| Comment by Garaudy Etienne [ 14/Jul/20 ] |
|
mark.benvenuto Did anything go wrong as a result of allowing array-like objects to pass as arrays? |
| Comment by Mark Benvenuto [ 07/Jul/20 ] |
|
This behavior is actually permitted by the IDL parser (https://github.com/mongodb/mongo/blob/09d7df7e8c53c593c254f589611931226a423ae9/src/mongo/idl/idl_test.cpp#L990-L1006). We will have to adjust the tests when the behavior is changed. |