Apple has sent out an urgent warning to those using its devices – which include iPhones, iPads and MacBooks – after hackers were able to "exploit" a security flaw.