In the practice of a system administrator, it sometimes happens that you begin to edit a script that automates the backup process, for example, but in the end it turns out that there is not enough rights to write to this file, which may be owned by root. In order not to dodge much in this situation, the changes are saved by the command
:w !sudo tee %
Security issues in this case are in the framework of sudo.