Skip to content
Crypto Write-up Advanced

Exploiting the Windows Cryptoapi Vulnerability

Windows Crypt32.dll failed to validate elliptic curve parameters in cached root certificates, allowing an attacker to forge a trusted root certificate and sign certificates for any website, bypassing TLS and code signing trust.

blog.trailofbits.com

Published on blog.trailofbits.com

On Tuesday, the NSA announced they had found a critical vulnerability in the certificate validation functionality on Windows 10 and Windows Server 2016/2019. This bug allows attackers to break the validation of trust in a wide variety of contexts, such as HTTPS and code signing.

The author, on blog.trailofbits.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, Crypt32.dll skipped validation of elliptic curve parameters for cached root certificates when the public key matched, allowing an attacker to supply a malicious generator and known private key.

Impact

Attackers could forge signatures for TLS, code, files, or email, enabling man-in-the-middle attacks and bypassing trust validation.

What the attacker needed

Windows 10 or Windows Server 2016/2019; Target uses a cached root certificate; Attacker can craft a malicious certificate

The fix

The vulnerability was fixed by adding checks during signature verification to ensure ECDSA parameters are authentic.

How it was found

  1. Pick a trusted root certificate from Microsoft's list.
  2. Generate a new private key for a malicious certificate defined over a different curve using explicit parameters.
  3. Calculate a generator such that the public key remains the same as the trusted certificate's public key.
  4. Generate a CA certificate using the mutated key.
  5. Sign a leaf certificate for any desired domain with the malicious CA certificate.
  6. Send the full chain including the malicious root certificate during a TLS connection to trigger the cache bug.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

When your computer checks if a website is secure, it looks at a digital certificate signed by a trusted authority. This bug let an attacker create a fake certificate that looked like it came from a trusted authority, so they could pretend to be any website or sign malicious software. The problem was that Windows didn't fully check all the details of the certificate's encryption settings.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.