Recently I have updated to SQL Server Management Studio 2016. After this update, query windows remain connected to the SQL instance even after we disconnect from that instance in the object explorer - queries can still be run without providing credentials.
This creates a huge risk while working on production and staging servers.
With earlier versions of SSMS (2008 or 2012), it used to ask for credentials to run queries in the query window if the object explorer no longer had a connection to the instance which that query window was connected to.
Below are the version details and an example of the problem behaviour:
Why is this happening and how can I prevent it?