A precocious pre-teen has prompted security warnings after creating a piece of malware for Apple’s iPhone.