[SERVER-8434] Text-indexing deeply nested documents can cause stack overflow Created: 01/Feb/13  Updated: 05/Apr/17  Resolved: 06/Mar/17

Status: Closed
Project: Core Server
Component/s: Security, Stability, Text Search
Affects Version/s: 2.3.2
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: J Rassi Assignee: Kyle Suarez
Resolution: Won't Fix Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Query 2017-01-23, Query 2017-02-13, Query 2017-03-27
Participants:

 Description   

Recursive calls made to mongo::fts::FTSSpec::_scoreRecurse, in mongo/db/fts/fts_spec.cpp.

To reproduce (on my OS X 10.8 machine, triggers if levels >= 2306):

function makeNestObj(depth){
    toret = {s : 1};
    for(i = 1; i < depth; i++){
        toret = {s : toret};
    }
    return toret;
}
db.foo.insert(makeNestObj(levels));
db.foo.ensureIndex({"$**":"text"})

(snippet above borrowed from SERVER-6462)



 Comments   
Comment by Kyle Suarez [ 06/Mar/17 ]

I'm closing this as Won't Fix because the issue only affects V1 text indexes. V2 text indexes use an iterative algorithm and are not subject to this problem.

Work in SERVER-26703 prevents users from inserting documents into the database that exceed the BSON depth limit, so I feel confident that this issue has been mostly mitigated and will only affect users using old text indexes and already have giant documents.

Generated at Thu Feb 08 03:17:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.