]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: ssl: reject an embedded NUL in the full-DN ssl_*_dn() fetches
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 12 Aug 2026 09:52:46 +0000 (09:52 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Wed, 12 Aug 2026 12:51:25 +0000 (14:51 +0200)
commit7c43f85abcabb985873fa09579b077e55d544ea0
tree97893cc0cf6df9fc14e5c6171729e805c0545c67
parent449133cba139e27afb291f509e884d3cf2789f94
BUG/MINOR: ssl: reject an embedded NUL in the full-DN ssl_*_dn() fetches

ssl_sock_get_dn_oneline() has the same flaw fixed in ssl_sock_get_dn_entry()
by the previous commit: it copies each DN component's ASN.1-declared bytes
verbatim via memcpy(), keeping an embedded NUL and whatever follows it. It
is used to build the full one-line DN returned by ssl_c_s_dn/ssl_c_i_dn/
ssl_r_dn when no field argument is given, so the same tree-vs-list ACL
match inconsistency applies to it.

Apply the same fix: reject the whole DN (return 0) if any entry has a NUL
followed by a non-NUL byte, and otherwise keep a single trailing NUL and
skip any extra ones.

This should be backported to every stable branch, alongside the previous
commit.
doc/configuration.txt
src/ssl_utils.c