[SERVER-48621] [v4.4] userAllowedCreateNS() does not check the collection name length in FCV4.4 Created: 05/Jun/20 Updated: 29/Oct/23 Resolved: 09/Jun/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | 4.4.0-rc8 |
| Fix Version/s: | 4.4.0-rc9 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Gregory Wlodarek | Assignee: | Gregory Wlodarek |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||
| Steps To Reproduce: | Here's a jstests/replsets repro:
|
||||||||||||||||||||||||||
| Sprint: | Execution Team 2020-06-15 | ||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||
| Description |
|
We have two different code paths where we check the collection name length. DatabaseImpl::_checkCanCreateCollection() and userAllowedCreateNS(). The latter function only checks the collection namespace length when running in FCV 4.2, but performs no length checks for FCV 4.4. Renaming a collection within the same database goes through userAllowedCreateNS() as it only needs to modify the catalog's metadata and allows the opportunity to create a collection with a name > 255 characters.
To fix this, we should add the non-FCV namespace length check from _checkCanCreateCollection() into userAllowedCreateNS() too. |
| Comments |
| Comment by Githook User [ 08/Jun/20 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: |