Get the latest tech news
How macOS protects your data from malware
Malware is bad software you don't want to encounter, as it can harm your Mac or cause data loss. Here's how to protect against it.
One common attack vector of Trojan horses is to silently replace software frameworks or system components with a malicious impostor version, which linked apps then unwittingly run. Buffer overflow malware for example appends a small amount of malicious code to the end of a URL, web page, script, or network packet - which when received and run on the client computer causes damage. Other types of network attacks include impostors, man-in-the-middle, credential theft, phishing, email spoofing, and Distributed Denial of Service (DDoS) in which remote computers flood servers with so much data they stop working.
Or read this on r/apple