Skip to content
Crypto Disclosed report Intermediate CVE-2025-4947

CVE-2025-4947: QUIC certificate check skip with wolfSSL

With wolfSSL as the TLS backend, curl does not verify the certificate's CN/SAN when connecting to an IP address over HTTP/3.

kurohiro Follow

Originally disclosed on HackerOne

  • Triaged in 32 hours
  • Fixed in 11 days
  • Disclosed after 11 days

Summary:

When using WolfSSL as the TLS backend, there is an issue where the CN or SAN in the certificate is not verified when connecting to an IP address over HTTP/3.

wolfSSL_X509_check_host is only called when peer->sni is not NULL. However, when an IP address is specified, peer->sni is NULL, so the verification does not occur.

Curl_vquic_tls_verify_peer()

#elif defined(USE_WOLFSSL)
  (void)data;
  if(conn_config->verifyhost) {
    if(peer->sni) {
      WOLFSSL_X509* cert = wolfSSL_get_peer_certificate(ctx->wssl.ssl);
      if(wolfSSL_X509_check_host(cert, peer->sni, strlen(peer->sni), 0, NULL)
            == WOLFSSL_FAILURE) {
        result = CURLE_PEER_FAILED_VERIFICATION;
      }
      wolfSSL_X509_free(cert);
    }

  }
#endif

Affected version

curl -V
WARNING: this libcurl is Debug-enabled, do not use in production

curl 8.13.0 (x86_64-pc-linux-gnu) libcurl/8.13.0 wolfSSL/5.8.0 zlib/1.3.1 libidn2/2.3.8 libpsl/0.21.2 ngtcp2/1.13.0-DEV nghttp3/1.1
Release-Date: 2025-04-02
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns mqtt pop3 pop3s rtsp smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS Debug HSTS HTTP3 HTTPS-proxy IDN IPv6 Largefile libz PSL SSL threadsafe TrackMemory UnixSockets

Steps To Reproduce:

I will explain using a connection to google.com as an example.

  1. Prepare curl with WolfSSL backend.
  2. To resolve the domain name google.com and obtain its IP address for testing purposes(142.251.222.14).
  3. curl --http3 https://142.251.222.14

When an IP address is specified, it should result in an error during CN/SAN verification, but no error occurs. An error occurs when using HTTP/1.1.

An error occurs when the TLS backend is OpenSSL.

Impact

CWE-297: Improper Validation of Certificate with Host Mismatch

The original report as published on HackerOne, by kurohiro. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

How it worked

Root cause

Likely the hostname verification is guarded by a check that the SNI value is present, and when connecting to an IP address no SNI is set, so the certificate host check is skipped entirely.

Impact

A certificate whose name does not match the target is not rejected over HTTP/3 with wolfSSL; the same test over HTTP/1.1 or with OpenSSL errors.

What the attacker needed

Curl built with wolfSSL backend; HTTP/3 support enabled; connection made to an IP address

How it was found

  1. Build or obtain curl with the wolfSSL backend.
  2. Resolve a domain such as google.com to its IP address for testing.
  3. Run curl over HTTP/3 against that IP address directly.

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 report has not been written yet. The Original tab links to the source.

When curl connects to a bare IP address over HTTP/3 using wolfSSL, the certificate name check is skipped, so a mismatched certificate is not rejected.

What is Crypto?

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

More by kurohiro

View all

9 more disclosed reports, best first.

More from curl

View all

The newest disclosed reports for this program.

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.