]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: acme: don't delete a NULL token from the map
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 6 Aug 2026 07:29:07 +0000 (09:29 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Fri, 7 Aug 2026 10:02:53 +0000 (10:02 +0000)
commitb5e77960c42864c98548cb4a882720b625bcf727
treeb99ebf397c882de503f7f9f992f8dd57a123c0d5
parentc494983b5d8171092e1ad8994519f02a9a84e65f
BUG/MEDIUM: acme: don't delete a NULL token from the map

When an ACME task ends, acme_del_acme_ctx_map() walks the list of
authorizations and removes each challenge token from the configured map.
But an authorization is created with only its URL set, and its token is
only filled in once the CA's answer for that authorization has been
successfully parsed. The "dns-persist-01" challenge type never sets one at
all. Every termination path of the task goes through that cleanup, so a
NULL token was passed to pat_ref_delete(), which compares it against the
keys of the reference and dereferences it.

For users this means that an ACME configuration using a "map" crashes the
worker whenever the certificate renewal fails early, for instance when the
CA is unreachable and the retries are exhausted, or when it answers
something unexpected. The very component that is supposed to keep the
service running then takes it down.

Let's simply ignore authorizations without a token, they have nothing
registered in the map anyway.

This was introduced in 3.2 by commit 5555926fd ("MEDIUM: acme: use a map
to store tokens and thumbprints"). It must be backported to 3.2.

Reported-by: Claude (ANT-2026-YXC5HJZS)
src/acme.c