Fortunately, Gmail does protect from ransomware attacks. All the files undergo a real-time scan before you can download or share them. In addition, Google Drive stores the files in a non-executable format, preventing ransomware from spreading within your Drive.