Proof-of-concept code for exploiting Windows crypto-spoofing bug published
Windows CryptoAPI flaw could enable attackers to launch man-in-the-middle attacks and to spoof signatures for emails and files
Security researchers have released two proof-of-concepts (PoC) for exploiting the Microsoft-NSA crypto-spoofing vulnerability (CVE-2020-0601) that was only patched and publicised on Tuesday.
The flaw, which is now being called CurveBall by some security researchers, impacts CryptoAPI (Crypt32.dll) module, which controls cryptographic operations in the Windows operating system.
On Thursday, Swiss cyber security firm Kudelski Security and a Danish security researcher going by name "Ollypwn" published their PoC exploits for Curveball vulnerability on GitHub.
Either exploit could allow an adversary to carry out man-in-the-middle (MIM) attacks, spoof signatures for emails and files, and to fake signed-executable code launched in Windows.
Kudelski Security revealed that they launched their exploit using a "curve P384" certificate, which used elliptic curve cryptography (ECC). They were able to create a key that was used to sign the certificate with an arbitrary domain name. Subsequently, Windows' CryptoAPI recognised the certificate as trusted.
'Ollypwn' explained that when Windows checks the authenticity of the certificate, it finds that the certificate is "signed by our spoofed CA."
"It then looks at the spoofed CA's public key to check against trusted CA's. Then it simply verifies the signature of our spoofed CA with the spoofed CA's generator - this is the issue," Ollypwn explained.
A third PoC exploit for Curveball vulnerability was also developed by British security researcher Saleem Rashid, although he didn't publish the exploit.
Rashid tweeted screenshots of his exploit abusing CVE-2020-0601 to fake TLS certificates and to set up websites that appeared like legitimate ones.
Earlier on Tuesday, Microsoft released a patch to fix CVE-2020-0601 vulnerability, which the company described as a serious flaw affecting Windows 10 and Windows Server 2016/2019.
The bug was discovered by the US National Security Agency (NSA), which decided to disclose it to Microsoft instead of using the flaw for intelligence operations.
According to security experts, this bug causes the Windows CryptoAPI to fail to properly validate digital certificates using ECC. This could allow an attacker to launch remote code execution by creating a certificate in order to disguise malware as a legitimate piece of software. The user never comes to know that the software was malicious, as the digital signature appears to be from a trusted provider.
CERT/CC security expert Will Dormann said that "by exploiting this vulnerability, an attacker may be able to spoof a valid X.509 certificate chain on a vulnerable Windows system."
In its advisory, the NSA recommended enterprises to patch the flaw immediately or prioritise systems that host critical infrastructure like VPN servers, DNS servers, or domain controllers.
The agency warned that the consequences of not patching the vulnerability would be severe, as sophisticated cyber actors would soon start creating remote exploitation tools for the bug.
In its Emergency Directive, the US Department of Homeland Security's Cybersecurity and Infrastructure Security Agency also advised agencies to "patch all affected endpoints within 10 business days."