"Apple has identified malware which infected a limited number of Mac systems through a vulnerability in the Java plug-in for browsers," Apple said in a statement. "The malware was employed in an attack against Apple and other companies, and was spread through a website for software developers."
No data was stolen, Apple said. As in the Facebook case, the company said hackers were only able to access a small number of Apple employees' Macintosh computers. Apple then isolated them from its network.
"There was no evidence that any data left Apple," the company said.
Facebook reported on Friday that it was "targeted in a sophisticated attack." Like Apple today, it said that there was no evidence that Facebook user data was compromised. Security experts told ABC News that it is likely that the only information compromised was what was on the personal computers of those employees whose machines were infected.
Both attacks used a vulnerability in Java, the software used to show much of the content on Web browsers. Because of that vulnerability, the Department of Homeland Security released a statement last month urging computer users to disable the software in browsers.
Apple said that its operating systems do not ship with Java installed. If a user installs Java, Apple's software will automatically disable it if it has been unused for 35 days. Apple will also be releasing a new update that will help against Java threats.
"To protect Mac users who have installed Java, today we are releasing an updated Java malware removal tool that will check Mac systems and remove this malware if found," Apple said today.
Apple and Facebook's announcements comes after Twitter's announcement on Feb. 1 that 250,000 accounts were compromised in an attack. Twitter told affected users to reset their passwords. The New York Times and the Wall Street Journal said their computer systems were infiltrated by Chinese hackers in late January.
With so many security breaches, this is a good time to make sure you are following basic online safety tips -- reset your passwords regularly, keep your anti-virus software up to date, and stay away from websites that seem questionable.