A bug in iOS is being exploited in a prank aimed at crashing iPhones and iPads using the power of simple text, flag and rainbow emojis. The bug has two variants. 

One text string includes a waving white flag emoji, a zero, a rainbow and a hidden character called a variation selector, which can be copied into an iMessage conversation and sent to anyone. The other is the same string of characters, but embedded within a contacts file, which can be shared via iCloud Drive to an iMessage contact.

Both will crash and iPhone or iPad to varying degrees, although the text string sent via a standard iMessage only appears to affect iPhones and iPads with iOS 10.1 or below. The boobytrapped contact card affects all versions of iOS 10, including the latest iOS 10.2, the Guardian can confirm.

The bug was originally reported by YouTuber EverythingApplePro, which has a history of reporting on iPhone crash pranks.

French iOS developer Vincent Desmurs, who claims to have discovered the bug, suggested that the issue is caused by Apple's handling of the variation selector and the emojis beside it. He said: "What variation selector 16 (VS16) does in this case essentially is tell the device to combine the two surrounding characters into one emoji, yielding the rainbow flag.

"The text you're copying is actually a waving white flag, VS16, zero, rainbow emoji. What I'm assuming is happening is that the phone tries to combine the waving white flag and the zero into an emoji, but this obviously can't be done."

Users sent either the emojis via iMessage or the contact card see their iPhone or iPad crash after a short period of time, either resulting in a full lock up requiring a reboot, or a partial lockup that triggers a quick reboot.

The irony of the prank this time is that by using the contact card it is quite difficult to avoid crashing the sender's smartphone or even Mac computer, if sent through the desktop Messages app.

Users will need to delete their iMessage conversation with whichever prankster sent them the boobytrapped emoji to avoid repeated crashes on opening the messages.

Some users have reported having their iPhones repeatedly locking up without being able to delete the conversation. Some have reported being sent a new message, or creating one with Siri before opening Messages to clear the block.

Apple's iOS has a history of abnormal strings of text or videos causing crashes , which are then used to prank iPhone and iPad users, crashing their devices and in some cases preventing them from re-opening certain apps without clearing the prank messages. Apple declined comment.