[SERVER-36859] DurableViewCatalogImpl::iterate does not validate database name before calling NamespaceString constructor Created: 24/Aug/18  Updated: 29/Oct/23  Resolved: 07/Sep/18

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

Type: Bug Priority: Major - P3
Reporter: Maria van Keulen Assignee: Justin Seyster
Resolution: Fixed Votes: 0
Labels: neweng, read-only-views
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:
Linked BF Score: 56

 Description   

The DurableViewCatalogImpl::iterate function checks whether a view's collection name is valid before attempting to call the NamespaceString constructor to prevent the constructor from uasserting. However, if the view's database name contains null characters, collectionNameIsValid will still be true because the database part of the name is not checked.



 Comments   
Comment by Githook User [ 07/Sep/18 ]

Author:

{'name': 'Justin Seyster', 'email': 'justin.seyster@mongodb.com', 'username': 'jseyster'}

Message: SERVER-36859 Skip view_with_invalid_dbname.js in parallel suite.

An invalid view in the system.views collection causes any other writes
to fail. That will cause most tests to fail if they run in parallel
with view_with_invalid_dbname.js.
Branch: master
https://github.com/mongodb/mongo/commit/2428d8b901a723743d3d62be2e394e33f09cc064

Comment by Githook User [ 07/Sep/18 ]

Author:

{'name': 'Justin Seyster', 'email': 'justin.seyster@mongodb.com', 'username': 'jseyster'}

Message: SERVER-36859 Validate dbname in DurableViewCatalogImpl::iterate().

If the DatabaseImpl constructor (which calls
DurableViewCatalogImpl::iterate()) throws an exception, the partially
constructed DatabaseImpl trips an invariant as it gets destroyed
during exception unwinding. This change makes sure that
DurableViewCatalogImpl::iterate() properly validates the 'viewOn'
namespace, so that it doesn't throw an exception when getting parsed
as a NamespaceString.
Branch: master
https://github.com/mongodb/mongo/commit/ec132343b7e7225e36575f173c242b383f505eb2

Comment by Ian Whalen (Inactive) [ 30/Aug/18 ]

assigning to justin to fix on 8/31 bf friday.

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