Can Macs Get Viruses?

As a software developer and Mac user, I’ve been doing a lot of research lately on whether Mac computers (iMac, MacBook, or Mac Pro) can get viruses, and I thought I’d share some more of my research here. The short answer is that yes, depending on your definition of a virus, one Mac can get a “virus,” at least a starter virus. As a simple example, imagine that I send you an email with an attachment, and you decide to open that attachment. If that attachment is malicious, it can delete all the files you own on your computer, including your photos, music, and any other files you have personally created. If that’s your definition of a virus, that can certainly happen.


However, most people define a virus as a malicious program that is smart enough to know how to transfer itself from one computer to another, wreaking whatever havoc it wants along the way. Mac OS X computers have not had a virus to date with this more proper definition of a virus.


Apple Has You Covered

On Apple’s website, they now show several large banners that say “We have you covered” regarding Macs, viruses, and malware. There are at least two primary technical reasons for their confidence regarding the lack of Mac Mac viruses. First, the Mac approach of setting up a separate “administrator” account for doing dangerous things alerts users to some malware approaches. For instance, while my script can delete the files you’ve personally created without asking for the administrator password, for me to delete all files on your Mac, I would have to prompt you to enter the administrator password Folk Fests. That’s not something you’re probably going to give me very easily, and instead of that, my script would have to find a hole in the Mac operating system that would easily grant me administrator access, and to date, that hole hasn’t been there.

Second, as mentioned, by definition, a virus is a program that spreads from one computer to another. Viruses jump from one computer to another using open network “ports” on computers. Network ports are like doors, and as you know, some doors are open, some doors can easily be opened, other doors are like bank vaults, and still other doors are like bank vaults but behind behind a fortress so large you don’t even know they’re there. This last approach is what happens with Macs. Because all Mac ships with a “firewall” enabled and no ports (doors) open, my malicious program can’t easily jump from one computer to another. And once again, even when a port is open, such as when Macs are in corporate locations, nobody has yet been able to exploit a partially-open door.

Buffer Overflow Attacks

Hackers also try other much more technical approaches to attack computers, typically “buffer overflow” attacks on systems (where a hacker sends more data to a program than the program is expecting). Still, without open ports on a Mac system, attacks like these have to happen through browsers or network Macs on a local area network (LAN). If a Mac ever gets a virus, you’ll probably hear more about this “buffer overflow” term, but again, nobody has successfully used this approach to date.

Apple Shares Mac OS X Lion With Security Experts

Interestingly, as I write this article, Apple has just provided an early release of their next operating system, Mac OS X 10.7 (“Lion”) with security experts. As the world of hackers, malware, and viruses get more complicated, Apple seems to be taking a proactive approach to sharing their OS X operating system with security experts as part of their normal development life-cycle.

Mac Viruses – Summary

In summary, yes, it’s theoretically possible for an iMac, Mac Pro, or MacBook to get a virus, but to date, nobody has created a virus for Mac systems. Also, as mentioned, Apple is getting more proactive in their approach by providing an early release of their “Lion” operating system to security experts, which is also a very healthy approach. Finally, most hackers these days seem to be focusing their efforts on other approaches, things like “phishing” and “spoofing,” to try to get at your information through your browser, so for the time being, these seem to be larger concerns than potential Mac viruses and malware. Alvin Alexander is the creator of and has written other Mac security articles, including this Mac antivirus article. He’s also written about more general Mac topics, including this MacBook skins article.

Roberto Brock
the authorRoberto Brock
Snowboarder, traveler, DJ, Swiss design-head and HTML & CSS lover. Doing at the nexus of art and purpose to develop visual solutions that inform and persuade. I'm a designer and this is my work. Introvert. Coffee evangelist. Web buff. Extreme twitter advocate. Avid reader. Troublemaker.