Apple has issued a warning to all 1.8bn iPhone users over a security threat following an "extremely sophisticated attack".