Updated2 Apple has updated its mobile operating system iOS to patch a bug that blows apart the integrity of encrypted connections.

Versions 7.0.6 and 6.1.6, available now for download, fixes a vulnerability that could allow "an attacker with a privileged network position" to "capture or modify data in sessions protected by SSL/TLS," according to the iPhone maker. This is due to the Secure Transport component of the operating system failing to validate "the authenticity of the connection," suggesting some sort of failure to verify the certificate or identity of whatever system a vulnerable iDevice was connected to.

In short, users should apply the security update as soon as possible to avoid falling foul of a man-in-the-middle attack: we can imagine a malicious router or Wi-Fi access point exploiting this iOS flaw to silently masquerade as a legit server, and thus intercept and decrypt the private contents of a supposedly secure connection.

SSL and TLS are used the world over to prevent eavesdroppers from snooping on network traffic to and from sensitive services, such as banking and shopping websites and email servers. But this only works if the other end of the connection can be verified and trusted.

Apple admits "this issue was addressed by restoring missing validation steps." It reserved CVE-2014-1266 for the bug on January 8 this year, but when and how exactly the flaw was introduced and subsequently discovered is not clear.

The patch, weighing in between 16MB and 35MB, can be applied to any handheld running iOS 7, and even iPhone 3GSes and fourth-generation iPods running version 6 – a further clue that Apple considers this a very serious bug.

The next major release, iOS 7.1, is due out in March once developers have finished beta testing it. ®

Updated at 1150 GMT, February 22

For those wondering what the problem is, it first appeared that there was an issue in Apple's port of download tool Curl involving the verification of the "common name", aka hostname, records in SSL certificates. It was feared that bug was part of a wider problem.

Although that particular glitch is real and irritating, it turned out not to be the showstopper that Apple patched on Friday: others have since uncovered a staggering cock-up that appeared in the latest available open-source code for Apple's SSL security library, specifically in the SSLVerifySignedServerKeyExchange() function.

Aptly, it's a double goto fail; so the code skips a vital verification step when exchanging keys with the server to prove its identity and authenticity. Oops.

The bad news is that this iOS validation bug also exists in Apple's Mac OS X 10.9.1 desktop operating system. Any software relying on Apple's SSL library will be at risk until it is patched, it's understood. Google Chrome and Mozilla Firefox are among the applications not affected, but Apple's Safari, Mail, Messages, and many other programs, are thought to be vulnerable.

"Update your Apple devices and systems as soon as possible to the latest available versions. Do not use untrusted networks (especially Wi-Fi) while traveling, until you can update the devices from a trusted network," advised Alex Radocea of computer security tech biz CrowdStrike in a briefing about today's SSL vulnerability.

"On unpatched mobile and laptop devices, set 'Ask to Join Networks' setting to OFF, which will prevent them from showing prompts to connect to untrusted networks."