A security researcher has discovered a fatal flaw that could affect any network using WPA2 protocols.

Researcher Matty Vanhoef discovered and has published the details of what has been labelled the KRACK (key reinstallation attack) flaw, which he found can be abused to steal sensitive data.

The weakness is in the WPA2 encryption protocol itself, meaning it could create vulnerabilities in any implementation of the standard.

The KRACK attack works on older WPA encryption as well as newer WPA2 protocols; the GCMP, AES-CCMP, and WPA-TKIP ciphers.

“The impact of exploiting these vulnerabilities includes decryption, packet replay, TCP connection hijacking, HTTP content injection, and others,” the United States Computer Emergency Readiness Team has warned vendors.

“Note that as protocol-level issues, most or all correct implementations of the standard will be affected.”

Enterprises with authentication-free networks are at particularly high risk.

KRACK attacks allow hackers to adopt a man-in-the-middle position and force access points and client devices to reinstall encryption keys designed to protect traffic.

There is a weakness in the third step of the four-way handshake that the protocol uses to authenticate devices.

Step three involves negotiating a fresh encryption key to encrypt traffic.

KRACK attackers can trick a victim device into reinstalling an already-negotiated encryption key.

A WPA2 access point can be made to transmit the third message - containing the key – if it does not receive an adequate response from the client device.

A KRACK attack could allow access to network traffic from a victim device, and hijack connections and in some cases to inject malware or ransomware into unencrypted HTTP connections.

Given that an attacker needs to directly connect with the wi-fi access point, remote and large-scale attacks are unlikely.

Apple, Windows, Android, OpenBSD, Linux and many other router vendors are potentially vulnerable to the flaw.

Android and Linux are especially vulnerable because they use a WPA-supplicant client that can be made to install an encryption key with a value of 0, instead of the real one.

This means an attacker could set up a fake wi-fi access point and intercept all traffic.

Mr Vanheof said 41 per cent of Android devices were vulnerable to KRACKs.

iOS and Windows do nott accept retransmissions of the third message, which actually goes against the WPA2 protocol, but happens to protect against a KRACK attack.

Mr Vanhoef found MacOS and OS X are vulnerable too.

Wi-fi network operators and users must now wait for their device vendors to provide a patch against the vulnerability.

A current list of affected devices is accessible here.