]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: acme: restrict the permissions of the generated account key master
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 6 Aug 2026 07:46:19 +0000 (09:46 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Fri, 7 Aug 2026 10:03:01 +0000 (10:03 +0000)
commit19d02b81f0952b65ebdbb8919501d2e5d6956765
tree51eca14a4a0e43c320f37dfee46a00e5018645ea
parent6c85fb11bfe77ca5e20cb5ff378aa67a01bccb5f
BUG/MINOR: acme: restrict the permissions of the generated account key

When no ACME account key exists yet, haproxy generates one and writes it
through a plain BIO_new_file(), so the file is created with the process'
umask applied. With the common 022 umask the unencrypted private key ends
up on disk as 0644, readable by every local user.

Whoever reads that key can authenticate to the CA as this haproxy ACME
account, and from there deactivate it or manipulate the orders and
revocations for the domains it has validated.

Let's restrict the file to 0600 right after creating it and before writing
anything into it.

This was introduced in 3.2 by commit 856b6042d ("MEDIUM: acme: generate
the account file when not found"). It must be backported to 3.2.

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