Skip to main content

KRACK shows that developers can’t rely on networks to manage security

(Image credit: Image source: Shutterstock/hywards)

Most users assume that a secure Wi-Fi connection will keep their activity safe, but the revelation of a serious flaw in the Wi-Fi Protected Access (WPA) protocol in October revealed that almost every Wi-Fi enabled device in the world is at risk. 

The Key Reinstallation Attacks, shortened to ‘KRACK’, creates the potential on some platforms for attackers to access data that was previously thought to be safely encrypted, and can even potentially enable hackers to inject malicious code or manipulate data.   

KRACK exploits the four-way handshake used by WPA2 to establish the nonce, a random number which is only ever used once as a way of preventing replay attacks which reuse old data transmissions. Attackers can repeatedly reset the nonce transmitted in the third step of the WPA2 handshake to gradually match more of the encrypted packets each time as the same values are reused. Eventually they can determine the full keychain used to encrypt the wireless traffic, granting full access to the network and all of the data it receives.  Data encrypted through applications using SSL will still be encrypted (though there have also been known vulnerabilities to SSL/TLS, like Heartbleed), but anything encrypted by WPA2 will be exposed.  

Most obviously, the flaw creates a significant opportunity for “near local” man-in-the-middle (MITM) attacks, enabling criminals to intercept or reroute data that is assumed to be being sent securely. We most commonly see these techniques used to intercept financial data during mobile payments. The KRACK exploit is so widespread, however, that an attacker could exploit it to steal any and all sensitive data being sent over Wi-Fi, facilitating everything from personal fraud to corporate espionage.   

Fortunately, the vendor community reacted swiftly to the KRACK revelation and most quickly worked to issue patches closing the exploit. Windows devices and newer versions of iOS were less impacted to begin with, but Android 6.0 Marshmallow and newer Android devices were seriously exposed, and many will still be vulnerable. 

While most devices will soon be protected from KRACK attacks if they are not already, the issue is not a closed case as the discovery of the exploit raises serious concerns about the security of Wi-Fi. KRACK is only the latest security vulnerability discovered in the WPA and WPA2 protocols, with previous exploits such as Hole196 and Predictable Group Temporal Key (GTK) also enabling attacks in recent years. 

Wi-Fi security beyond KRACK 

Despite the continued discovery of security issues, most users generally assume a secure Wi-Fi connection will keep their activity protected, and there is also a tendency for developers and vendors to rely on Wi-Fi security protocols to secure data transmitted by their products. This approach means that users will be left exposed again when the next exploit is inevitably discovered.  

Instead of relying on Wi-Fi protocols to keep their users safe, we urge all developers to take the security of their applications into their own hands. Arxan’s State of Application Security Report, which examined the security measures of some of the most popular mobile financial and healthcare apps, found that the vast majority had major gaps in their security.   

92 per cent of the apps we tested had at least two of the OWASP Mobile Top 10 Risks – an industry guide used for identifying critical mobile security risks. One of the most common issues was insufficient transport layer protection, which was common in 91 per cent of apps. Poor security in this area leaves apps even more vulnerable to MITM attacks, even before considering exploits like KRACK. 

Is encryption the answer?   

One of the most effective solutions to keep data safe in the event of further Wi-Fi vulnerabilities is to implement end-to-end encryption (E2EE) for all data in transit. This means that even if data is intercepted in an MITM type attack, it will still be kept safe from the attacker.  

However, it’s important to note that E2EE can be circumvented if a hacker is able to gain access to the app and gain the encryption keys. We have found that a worryingly high number of apps are unprepared for this scenario, and 98 per cent of the apps we examined in our State of Application Security Report lacked the binary protection measures needed to keep their binary code safe from unauthorised access.   

Getting a hold of an app’s binary code enables a whole host of malicious activity, such as stealing code to create a rival app, or even purposefully creating an exact clone that is redistributed with malware. In this case, attackers will also be able to root out any encryption keys used in E2EE processes, which will enable them to decrypt any data they intercept.   

Focus on binary protection   

To prevent attackers from breaking an app’s security and rifling through its code, developers should be implementing a range of techniques in their development cycle. Hardening techniques such as obfuscation, which renders code into unusable scrambled code to attackers, should be deployed as standard. Hiding text encodings, encryption, and changing easy-to-understand program symbol names, will also make it much more difficult for an attacker to exploit the code. 

More advanced measures include debugger detection, which will detect if the app has been executed in a debugging environment rather than a real device. Hackers commonly run apps in sandboxes to enable them limitless time to probe for weaknesses, so if the app is able to detect this it can prevent itself from opening. Checksums can also be hidden within the code, triggering an alert if the code is altered during runtime.   

To protect the cryptographic keys used for encrypting data, as well as other tasks such as binding devices to accounts and proving user identity, developers should consider white-box cryptography, which can see off extensive attackers by even the most experienced hackers.   

While it’s only a matter of time before another major flaw in Wi-Fi or standard network security is discovered, if developers take their security into their own hands, they can ensure that important user data remains protected. Of course, with attackers growing steadily more innovative in their approach, and mobile apps in particular already being vulnerable to being hacked, developers should already be exploring these security measures as a baseline of security for their users.    

Rusty Carter, VP of Product Management at Arxan Technologies 

Image Credit: Hywards / Shutterstock

Rusty Carter
Rusty Carter is VP of Product Management at application security specialist Arxan Technologies.