[SERVER-26703] Inserting deeply-nested documents should fail with error Created: 19/Oct/16 Updated: 04/Apr/19 Resolved: 13/Mar/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Security, Write Ops |
| Affects Version/s: | None |
| Fix Version/s: | 3.4.4, 3.5.5 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | J Rassi | Assignee: | Kyle Suarez |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Backwards Compatibility: | Major Change | ||||||||||||||||||||||||||||
| Backport Completed: | |||||||||||||||||||||||||||||
| Backport Requested: |
v3.4
|
||||||||||||||||||||||||||||
| Sprint: | Query 2017-01-23, Query 2017-02-13, Query 2017-03-27 | ||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||||||||||||||
| Description |
|
From the MongoDB Limits and Thresholds docs page:
The server should fail insertion of these documents with an error returned to the user. This would make the server's behavior consistent with the documentation. Furthermore, if code in the server can assume that the nesting limit is fairly small, and the server can assert that the stack is of some known minimum size at time of process start, then recursive algorithms in the server can executed safely on these documents without concern of stack overflow. To reproduce, run the following shell snippet.
|
| Comments |
| Comment by Githook User [ 28/Mar/17 ] |
|
Author: {u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'kyle.suarez@mongodb.com'}Message: Any command sent to the server that exceeds the depth limit will fail. This also prevents users from (cherry picked from commit d98143c5db73a8a9a49ef20e9e0f2732b4de5063) |
| Comment by Githook User [ 13/Mar/17 ] |
|
Author: {u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'kyle.suarez@mongodb.com'}Message: Any command sent to the server that exceeds the depth limit will fail. This also prevents users from |
| Comment by Githook User [ 06/Mar/17 ] |
|
Author: {u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}Message: Revert " This reverts commit c2b3178e0cae20a24bc9cc39a750bb864def17e3. |
| Comment by Kyle Suarez [ 06/Mar/17 ] |
|
I'm marking documentation changes as "Not Needed" because the BSON depth limit has always been around (see https://docs.mongodb.com/manual/reference/limits/#Nested-Depth-for-BSON-Documents). We may not have enforced it explicitly in the past, but I don't see a reason to change the docs unless someone disagrees. |
| Comment by Githook User [ 06/Mar/17 ] |
|
Author: {u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'kyle.suarez@mongodb.com'}Message: Any command sent to the server that exceeds the depth limit will fail. This also prevents users from |