Security

CSO

Months after NSA disclosed Microsoft cert bug, datacenters remain unpatched

You know when we all said quit using MD5? We really meant it


Most Windows-powered datacenter systems and applications remain vulnerable to a spoofing bug in CryptoAPI that was disclosed by the NSA and the UK National Cyber Security Center (NCSC) and patched by Microsoft last year, according to Akamai's researchers.

CryptoAPI helps developers secure Windows-based apps using cryptography; the API can be used, for instance, to validate certificates and verify identities.

The vulnerability in question (CVE-2022-34689) can be exploited by miscreants to digitally sign malicious executables in a way that tricks Windows and apps into believing the files are from trusted, legitimate sources and can be opened or installed. Exploiting this will involve getting said files onto victims' machines and run.

Alternatively, an attacker can craft a TLS certificate that appears to belong to another organization and trick an application into trusting the cert, if that application uses CryptoAPI to analyze the certificate. The app believes the attacker is the spoofed organization. The bug isn't a remote code execution flaw; it's a vulnerability that allows someone to pretend to be another to an application or operating system, in the context of identity and certificate cryptography checks on Windows.

Microsoft quietly patched the vulnerability in August 2022; though it was labeled critical, it was given a CVSS severity score of just 7.5 out of 10. Later, when Redmond disclosed the bug in October, the IT giant said the security flaw hadn't been exploited and wasn't publicly known, but it did deem "exploitation more likely."

And now that Akamai has published proof-of-concept code that demonstrates exploitation, Microsoft's fears perhaps inch closer to reality. The PoC demo exploits an old version of Chrome on Windows, which uses CryptoAPI to check certificates, using a man-in-the-middle attack to make the browser think it's talking to the legit server for a HTTPS website but is in fact using a malicious fake. The PoC doesn't get more useful than that.

Akamai also asserted that the vast majority of public-facing Windows-powered servers in datacenters around the world it has studied haven't been patched to close the hole. We note that for the bug to be exploited in practice, there needs to be an application or service running on the box that uses CryptoAPI in a way that opens it up to spoofing. For an attack to succeed, there needs to be

"We found that fewer than one percent of visible devices in data centers are patched, rendering the rest unprotected from exploitation of this vulnerability," Akamai security researchers Tomer Peled and Yoni Rozenshein concluded.

When asked if this means that 99 percent — virtually all — Windows datacenter endpoints remain vulnerable, Peled clarified to The Register:

Yes, we can confirm that from the subset of endpoints we scanned we found that 99% were not patched with the August security patch, but that does not mean that the endpoint is vulnerable because there also needs to be a vulnerable app to take advantage of this exploit.

The researchers said they did poke around for vulnerable applications that use CryptoAPI in a way that is vulnerable to this spoofing attack. "So far, we found that old versions of Chrome (v48 and earlier) and Chromium-based applications can be exploited," the duo wrote. "We believe there are more vulnerable targets in the wild and our research is still ongoing."

There's a video [MP4] you can watch demonstrating exploitation against Chrome but here's the short version of that spoofing attack simply put. 

At the heart of it, Microsoft used the hashing algorithm MD5 to index and compare security certificates. It's trivial to break MD5 with what's called a collision: a situation where two different blocks of data result in the same MD5 hash value. What's more, Microsoft used the four least-significant bytes of a certificate's MD5 thumbprint to index it.

So what you need to do is this: trick an application such as Chrome 48, which uses the Windows CryptoAPI, into connecting to a man-in-the-middle server that wants to pretend to be the website the user actually wanted. The malicious server sends the impersonated website's legit HTTPS cert to the browser, which passes it to CryptoAPI for processing and the cert is cached in memory on the user's PC.

The cert is stored in this cache using part of the MD5 thumbprint of the cert's data as the index. The malicious server meanwhile modifies the legit certificate so it can masquerade as the website, and ensures this new tampered-with evil certificate results in the same MD5-computed cache index as the real one. The server causes the browser to ask for the website's certificate again, at which point the server hands over the evil cert.

The CryptoAPI library computes the MD5 fingerprint for the evil cert and its index in the cache, sees that there's already a valid cert in the cache for that index, and thus trusts the evil certificate. Now you've tricked the system into thinking the malicious cert is real. How this is exploited in the real world to cause actual harm... well, you need to be a skilled and determined miscreant, and there are probably easier security weaknesses to target. See the above link to Akamai's write-up for full technical details.

"The root cause of the bug is the assumption that the certificate cache index key, which is MD5-based, is collision-free," the researcher duo explained. "Since 2009, MD5's collision resistance is known to be broken." 

It's worth noting that the NSA also found and disclosed to Microsoft a similar CryptoAPI bug in 2020 tracked as CVE-2020-0601 that also could lead to identity spoofing. 

However, while the older vulnerability affected many unpatched systems and was a favorite among Chinese state-sponsored criminals, this latest "CVE-2022-34689 has more prerequisites and thus has a more limited scope of vulnerable targets," according to Akamai.

"That being said, there is still a lot of code that uses this API and might be exposed to this vulnerability, warranting a patch even for discontinued versions of Windows, like Windows 7," the researchers added.

The Register asked Microsoft what its takeaways were from the research and whether the IT giant planned to issue a patch for older Windows versions. A spokesperson instead told us: "We released a security update last year, as part of our normal Update Tuesday process. We recommend that customers apply the update to help stay secure and protected." ®

Send us news
3 Comments

Attacks abuse Microsoft DHCP to spoof DNS records and steal secrets

Akamai says it reported the flaws to Microsoft. Redmond shrugged

Microsoft issues deadline for end of Windows 10 support – it's pay to play for security

Limited options will be available into 2028, for an undisclosed price

Fancy Bear goes phishing in US, European high-value networks

GRU-linked crew going after our code warns Microsoft - Outlook not good

Google submits complaints about Microsoft licensing to UK competition regulator

Now Microsoft has regulator breathing down its neck in three regions

Microsoft's bug bounty turns 10. Are these kinds of rewards making code more secure?

Katie Moussouris, who pioneered Redmond's program, says folks are focusing on the wrong thing

A year on, CISA realizes debunked vuln actually a dud and removes it from must-patch list

Apparently no one thought to check if this D-Link router 'issue' was actually exploitable

Two years on, 1 in 4 apps still vulnerable to Log4Shell

Lack of awareness still blamed for patching apathy despite it being among most infamous bugs of all time

Five Eyes nations warn Moscow's mates at the Star Blizzard gang have new phishing targets

The Russians are coming! Err, they've already infiltrated UK, US inboxes

FTC wants Microsoft's relationship with OpenAI under the microscope

Hey Bing, how can I invest billions in a company but not break antitrust laws?

Microsoft partners with labor unions to shape and regulate AI

Redmond reassures AFL-CIO workers they won't be pushed out by technology

Experienced Copilot help is hard to find, warns Microsoft MVP

Almost nobody has used it, or knows it well, so beware of consultants bearing cred

Dump C++ and in Rust you should trust, Five Eyes agencies urge

Memory safety vulnerabilities need to be crushed with better code