Apple has released a software update to fix the Flashback malware which relates to a vulnerability in Java.

The update is called 'Java for OS X Lion 2012-003' and Apple recommends all users running Java install the patch. It was revealed last week that the malware had infected more than 600,000 Macs.

Apple said: "This Java security update removes the most common variants of the Flashback malware."

"This update also configures the Java web plug-in to disable the automatic execution of Java applets. Users may re-enable automatic execution of Java applets using the Java Preferences application. If the Java web plug-in detects that no applets have been run for an extended period of time it will again disable Java applets." is added.

The iPhone maker announced it was working on the fix earlier this week. Security firm Symantec reported that the number of infected machines had dropped significantly to around 270,000.

The exploit saves an executable file onto the hard drive of the infected Mac and then goes on to harvest sensitive information including passwords.