A "severe" security problem with WhatsApp could have left "hundreds of millions" of accounts vulnerable to hackers, according to researchers that discovered a flaw in the app.

The bug, which affected the web version of the messaging app, would have allowed people with technical knowledge to take over users' accounts with a simple message. Clicking and opening a malicious file could have let hackers see victims' conversations, photos, videos, contacts, shared files and more, security researchers at Check Point said.

WhatsApp has now fixed the problem, which could also have been used to take over accounts belonging to victims' friends.

"Attackers could potentially download your photos and or post them online, send messages on your behalf, demand ransom and even take over your friends' accounts," said the researchers.