]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: ocsp: fix NULL dereference when the OCSP responder sends no header
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Thu, 19 Nov 2026 15:44:03 +0000 (16:44 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 20 Nov 2026 11:36:57 +0000 (12:36 +0100)
commitd4c0c5fdada7058f77667f913b6394b8beabc6af
treeafc10ed58689df4dbc7cb750495ed730def31f10
parentbd2c92daba75b31b72375b1636c29bfc904275ec
BUG/MINOR: ocsp: fix NULL dereference when the OCSP responder sends no header

Both OCSP response handlers look for a "Content-Type" header in the
response received from the responder by iterating over hc->res.hdrs
until they reach the end-of-array marker. But this array is only
allocated when the response contains at least one header so the array
may be NULL.

This is reachable in production as soon as the OCSP auto-update is
enabled. Any responder which answers with a header-less HTTP/1.0
response (a plain error page, a minimal embedded server, a proxy that
strips the headers) crashes the worker. The same issue applies to the
client-certificate OCSP check used by the "do-ocsp-request" action,
where the request is sent to the URI found in the client certificate.

This patch must be backported to 3.3.
src/ssl_ocsp.c