From: William Lallemand Date: Tue, 1 Dec 2026 10:09:18 +0000 (+0000) Subject: BUG/MEDIUM: ssl: fix verify bypass on duplicated crt-list ssl configs X-Git-Url: https://git.kaiwu.me/http/%22..//%22data:,/%22?a=commitdiff_plain;h=c91c9449cbc94df36e8cf99aeb53974122a10252;p=haproxy.git BUG/MEDIUM: ssl: fix verify bypass on duplicated crt-list ssl configs crtlist_dup_ssl_conf() duplicates a ssl_bind_conf for the crt-list entries created by the multi-keytype bundle emulation (crt.pem.ecdsa + .pem.rsa) and for each "ssl-f-use" rule, but it never copied the verify, no_ca_names, early_data and ktls scalar fields. Because dst is allocated with calloc(), the duplicates always carried verify == SSL_SOCK_VERIFY_NONE, so the switch in ssl_sock_prepare_ctx() fell back to the bind-level ssl_conf and configured OpenSSL with SSL_VERIFY_NONE: a "verify required ca-file" set on a crt-list line or on a ssl-f-use line was silently ignored for every keytype of a bundle (and for the whole frontend with ssl-f-use), letting unauthenticated clients complete the TLS handshake and reach the backend with ssl_c_used == 0, without any warning at startup or under "haproxy -c". The bundle duplication exists since 2.3 and the ssl-f-use rules since 3.2. Copying the scalar fields is enough to restore the intended behaviour: entry-level verify is now enforced on every duplicated entry. Note for backports: the ktls field of struct ssl_bind_conf was introduced in 3.3 (e8674658aec "MINOR: cfgparse: Add a new ktls option to bind and server"), so the "dst->ktls = src->ktls;" line must be dropped when backporting to 3.2, 3.1 and 3.0. The other three fields (verify, no_ca_names, early_data) exist in every concerned branch. Reported-by: Dominik Maier --- diff --git a/src/ssl_crtlist.c b/src/ssl_crtlist.c index 023f8ebc9..529b4344c 100644 --- a/src/ssl_crtlist.c +++ b/src/ssl_crtlist.c @@ -117,6 +117,12 @@ struct ssl_bind_conf *crtlist_dup_ssl_conf(struct ssl_bind_conf *src) dst->alpn_len = src->alpn_len; } #endif + + dst->verify = src->verify; + dst->no_ca_names = src->no_ca_names; + dst->early_data = src->early_data; + dst->ktls = src->ktls; + if (src->ca_file) { dst->ca_file = strdup(src->ca_file); if (!dst->ca_file)