A security researcher says a vulnerability in Apple’s mobile email application could be used to trick someone into divulging their iCloud password.

Prague-based Jan Soucek published proof-of-concept code that shows how he could send an email to someone with HTML code that resembles the iCloud login pop-up window. Soucek then receives an email containing the password.

The vulnerability allows remote HTML content to be loaded in an email, which replaces the content of the email message. Soucek wrote he then built a functional password collector using HTML and CSS. He also published a demonstration video.

He found the bug in January and notified Apple. The bug wasn’t fixed in iOS 8.1.2, “therefore I decided to publish the proof of concept code here,” he wrote. Apple officials did not immediately comment.

Soucek rigged the exploit code so that the bogus iCloud authentication window is only displayed once, which reduces suspicion, he wrote.

Apple has taken steps to strengthen the security of iCloud accounts after ones belonging to many celebrities were compromised last year.

The celebrity iCloud accounts may have been accessed after hackers guessed their usernames and passwords, possibly by answering the security questions Apple poses if someone loses their password.

It’s also possible the celebrities fell victim to phishing attacks, which makes Soucek’s finding even more worrying.

With iCloud credentials, it is possible to download the entire contents of an account to a new device, including photographs, text messages, call logs, address books, calendars and other information depending on what a person has chosen to store on iCloud.

Even if iCloud credentials are compromised, Apple has put other defenses in place. It now offers two-factor authentication and sends notifications when a new device is used to access an account or a password is changed.