]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: jwt: don't take an extra reference on the certificate public key
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Thu, 6 Aug 2026 07:35:42 +0000 (09:35 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 7 Aug 2026 08:49:27 +0000 (10:49 +0200)
commitd09e44d51b7ca6f0ee67b3bc1213aa77ec93edf6
tree464d790a3b64b0bf4a0346105e8bcbaa4c943514
parentba26a4e85311761928b58b2c58a2c15da1e02cd6
BUG/MINOR: jwt: don't take an extra reference on the certificate public key

X509_get_pubkey() already returns an owned reference, so the extra
EVP_PKEY_up_ref() on the cert-store path leaked one reference per
verification, since only one EVP_PKEY_free() is done afterwards. Over
time this means key objects accumulate and are never released, even
across certificate reloads.

Drop the extra reference. The "jwt_cert_tree" path below still needs
its up_ref, since it only holds a borrowed pointer.

Introduced in 3.3 by 522bca98e ("MAJOR: jwt: Allow certificate instead
of public key in jwt_verify converter"). Must be backported to 3.3.

Reported-by: Claude (ANT-2026-PKPCQ3ZN)
src/jwt.c