Hackers have been using compromised websites to install “monitoring implants” in iPhones for years, according to researchers at Google.
The malicious software gathers users’ images, contacts and other information.
Ian Beer, from Google’s Project Zero, said in a blog post that the hacked sites had received thousands of visitors each week.
Mr Beer said: “There was no target discrimination; simply visiting the hacked site was enough for the exploit server to attack your device, and if it was successful, to install a monitoring implant.”
Project Zero is the technology company’s team for examining new security vulnerabilities.
Mr Beer said most of the security flaws were found within Safari, the default web browser on Apple devices.
Operating systems from iOS 10 to iOS 12 were targeted in the hack, which was able to access users’ apps including Instagram, WhatsApp and Gmail.
Google said it reported the security issues to Apple on February 1.
Apple then released an operating system update on February 7.
Mr Beer warned that while the implant is not saved on Apple devices, it can again provide access to hackers when the owner visits a “compromised site”.
“Given the breadth of information stolen, the attackers may nevertheless be able to maintain persistent access to various accounts and services by using the stolen authentication tokens from the keychain, even after they lose access to the device,” he said.
Apple did not immediately respond to a request for comment.
How to check on your updates
iPhone users should check their device is running the most up-to-date version of iOS in order to ensure they are protected from the flaw.
Users can check their software version by going to the Settings app on their device, selecting General and then tapping on the Software Update option.
Any required updates will then be displayed here, which users can select to install.
The most recent update currently available is iOS 12.4.1.
Apple's iOS is considered one of the most secure operating systems available because both it and the devices it runs on are built and managed by Apple - with little chance for gaps to appear between hardware and software that could be exploited by hackers.