[SERVER-28074] Overly eager check for .system. in collection names causes error / assertion Created: 22/Feb/17  Updated: 22/Feb/17  Resolved: 22/Feb/17

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

Type: Bug Priority: Major - P3
Reporter: Steffan Mejia Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-4558 namespace validation on insert uses s... Backlog
Related
related to SERVER-19019 Fatal assertion when failing to creat... Closed
Operating System: ALL
Steps To Reproduce:

db.tmp.mr.system.users_1882.insert({a:1})

Participants:

 Description   

Appears to be the result of the code in insert.cpp in userAllowedCreateNS

Specifically

 if (coll.find(".system.") != string::npos) {
// this matches old (2.4 and older) behavior, but I'm not sure its a good idea
        return Status(ErrorCodes::BadValue,
                      str::stream() << "cannot write to '" << db << "." << coll << "'");
}

This conditional looks for .system. anywhere in a collection name.

It appears to have caught a user supplied collection name of tmp.mr.system.users_1882


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