#1151671 DSA 6572-1 may be ineffective for systems installed w/ d-i from https

Package:
debian-installer
Source:
debian-installer
Description:
Debian Installer documentation
Submitter:
Holger Levsen
Date:
2026-11-23 12:03:01 UTC
Severity:
normal
Tags:
#1151671#5
Date:
2026-10-22 21:20:28 UTC
From:
To:
package: debian-installer
severity: important
x-debbugs-cc: xam@debian.org

#1151671#10
Date:
2026-10-24 15:06:02 UTC
From:
To:
Hi,

I can confirm this issue on a freshly installed Debian 13 system, installed via netboot/preseed using an HTTPS mirror.
The installer used bootstrap-base 1.226.

Despite ca-certificates being updated to 20250419+deb13u1, I found 150 certificates in /usr/local/share/ca-certificates, including Comodo_AAA_Services_root.crt and emSign_ECC_Root_CA_-_G3.crt.

Both are marked as disabled in /etc/ca-certificates.conf, but their local copies remain trusted. Running update-ca-certificates --fresh
does not resolve this, as it picks up those copies again.

I verified that bootstrap-base.postinst copies the installer's /etc/ssl/certs/*.crt into /target/usr/local/share/ca-certificates when using HTTPS. A comparison installation using a netinst CD, with ca-certificates installed after first boot, has an empty local certificate directory and does not exhibit the problem.

This has a significant security impact: an up-to-date system can continue trusting certificates explicitly removed by a security
update.

Thanks,

#1151671#13
Date:
2026-10-28 19:42:57 UTC
From:
To:
Hi Cyril, all,

Pascal's testing seems to confirm that the copying is not required for
the regular case - https mirror or https preseed URL covered by the CAs
in ca-certificates.

For custom CAs, did we ever document how to include them in d-i in a way
that we should try to support going forward? A cursory search didn't
bring up any documentation. If not, I'd tend to just remove the copying
from base-installer and leave it to the preseeder to include e.g. a
suitable late_command to copy over the certs into /target.

(That's what I've been doing in my preseeding setups)

This has been in the back of my head all week. I think ca-certificates
can and should purge these cert copies. I've opened a draft MR on salsa
https://salsa.debian.org/debian/ca-certificates/-/merge_requests/18 and
asked Julien (CCed) for thoughts. Still details to be hashed out.

Ouch, that's also quite bad. :(

Best regards,
Max

#1151671#18
Date:
2026-10-29 20:24:11 UTC
From:
To:
[bug mail address fixed]

Do you see any case where it might be complicated, inconvenient or
impossible to preseed the copying of custom CA certificates ?

If yes, an option would be for bootstrap-base.postinst to not copy
certificates which are provided by ca-certificates-udeb. I guess it
would require to ship a list of these certificates or their hashes,
either provided by ca-certificates-udeb or generated when building the
d-i image.

Otherwise, let's just remove the copying.

#1151671#23
Date:
2026-10-29 20:32:31 UTC
From:
To:
Couldn't we just copy those then clear them out as part of the
post-installation step? Wouldn't that be an easy fix?

#1151671#28
Date:
2026-10-29 21:24:14 UTC
From:
To:
Steve McIntyre <steve@einval.com> (2026-10-29):

But everyone else dropped?

I think I suggested that in my first reply last week?


Cheers,

#1151671#33
Date:
2026-10-29 21:55:53 UTC
From:
To:
Sorry, could have been clearer - I'm agreeing with you! :-)
#1151671#38
Date:
2026-10-29 22:26:54 UTC
From:
To:
D'oh! Thanks :)

Yes. I tested without the copying code in bootstrap-base.postinst:

(a) an https mirror with a certificate signed by a CA included in
ca-certificates. Install completed fine.

(b) an https mirror that needs a custom CA. This worked for
install_base_system but failed in apt_update. It turns copying *is*
required in this case and doing it in late_command is too late.

The reason my preseeding setup worked was precisely because of the
copying - not because of my late_command as I thought.

How would we identify the certs to be cleared out though? This seems
non-trivial and potentially error prone - or am I just not seeing the
easy solution?

What if we instead mirror what ca-certificates does and require any
custom CA certificates to be in /usr/local/share/ca-certificates in the
installer and then copy that into /target?

Getting the custom certificate into the installer already requires
creating the hash symlink in /etc/ssl/certs manually for lack of openssl
rehash / c_rehash:

d-i preseed/early_command string \
    somehow_create /etc/ssl/certs/XXX.crt; \
    ln -s /etc/ssl/certs/XXX.crt /etc/ssl/certs/HHHHHHHH.0;

Or building the hash symlink into the image itself along with the
certificate. That would be no more difficult if we required the certs to
be in /usr/local/share/ca-certificates:

d-i preseed/early_command string \
    somehow_create /usr/local/share/ca-certificates/XXX.crt; \
    ln -s /usr/local/share/ca-certificates/XXX.crt /etc/ssl/certs/HHHHHHHH.0;

Thoughts?

Best regards,
Max

#1151671#43
Date:
2026-10-30 23:03:56 UTC
From:
To:
Yes, preseed/late_command is triggered way too late to copy custom
certificates. It would require to trigger a command right after the
bootstrap base installation, before using apt-install to download the
kernel package and additional packages from the mirror.

Maybe by comparing them with certificates installed by ca-certificates ?
I agree, this is non-trivial and error-prone. For example if the mirror
has a ca-certificates version newer than the ca-certificates-udeb used
in the installation image and a compromised certificate was removed from
the newer version, then this certificate would not be removed from the
target system, unless ca-certificates has a purging mechanism such as
proposed in your merge request 18.
It looks like a good idea to me. Separating default and custom
certificates would be cleaner and AFAICS without any added complexity
into d-i nor for users.

Also, the copying could be made unconditional regardless of whether a
https mirror was selected or preseeded: if custom certificates are
present, it must be for a reason. It could be something like this:

<https://salsa.debian.org/pham/base-installer/-/commit/6854a72b0e77>

#1151671#48
Date:
2026-11-22 11:06:06 UTC
From:
To:
Control: tags -1 patch
<https://salsa.debian.org/installer-team/base-installer/-/merge_requests/15>

#1151671#55
Date:
2026-11-23 08:10:12 UTC
From:
To:
Should this be Severity critical/serious?

Thanks Pascal! I think that's a good solution.

Best regards,
Max

#1151671#64
Date:
2026-11-23 08:59:54 UTC
From:
To:
Hallo Max,

Max Vozeler <xam@debian.org> (2026-11-23):
point of view (possibly on the communication/perception from the outside
front?), but either of those would make that eligible for fixing in
stable (we've been known to fix even “just important” bugs anyway).

What worries me is the behavorial change, and the required documentation.
Given the impacts of this issue, I think it would make sense not to
maintain the status quo and to require people to update their config.

Thinking out loud a little more: assuming we have proper documentation
in place (including a dedicated stanza in the point release announcement
maybe), people who wouldn't do anything in the first place would
suddenly be missing certificates, look around, and update their config.
Slightly annoying, but workable, I think?

Color me convinced.

I know you've already put quite some time and effort into this, so
feel free to tell me off if that's too much: are you in a position to
hotfix a stable installer and see if that works fine in your use case?
Otherwise I'll try and block some time for that.

Of course, nothing stops us from uploading to unstable and toying with
daily builds, but given the existing doubt regarding eligibility (see
above), I'd rather make extra sure the technical side is rock-solid.

Vielen Dank!


Cheers,

#1151671#69
Date:
2026-11-23 09:39:11 UTC
From:
To:
Cyril Brulebois <kibi@debian.org> (2026-11-23):

The more I think about this, the more I feel in “quite uncomfortable”
territory… especially since we have an alternate way to deal with this
that doesn't rely on introducing a behavorial change in stable…

My current preference would be something along those lines:
 - Introduce whatever changes we want in unstable/testing to make the
   situation and implementation clearer in the future (Pascal's proposal),
   also making sure to update documentation as needed, and also some code
   (see SSL_CERTS in src:debian-installer).
 - Minimally-patch the stable installer to avoid this issue, without
   changing anything else.

I'm also quite unhappy with the unstable/testing versus stable divergence
but not requiring users to update their config seems worth it to me.


Regarding the implementation, we could have ca-certificates-udeb augmented
with metadata but that would require an extra upload, so adjusting the
build system in debian-installer looks easier. At the moment we're pulling
this package everywhere anyway:

    $ git grep ca-certificates-udeb
    build/pkg-lists/base:ca-certificates-udeb

Seeing how build/Makefile and other helpers routinely use `dpkg-deb
--info`, I don't think it would be crazy to use `dpkg-deb --contents` to
obtain the list of files shipped by ca-certificates-udeb and generate a
file to be picked up for a final cleanup.

I'm fine with looking into implementing this.


To be clear, I'm absolutely not meaning to insist on what was my initial
reaction, but at least Steve was thinking the same way, Pascal mentioned
we would have to be careful and keep track of ca-certificates-udeb files,
which this approach would address (not sure yet whether filenames are
sufficient or whether we should look the contents as well; I think the
former may be good enough)… and if that makes sense to everyone, we
would hit the pause button on Pascal's MR for now, deploy the changes to
src:debian-installer's git repository which would make them testable via
daily builds (even if a release is long overdue, and on my short term
list, but that's another story), together with an updated base-installer
package.

That would resolve the “unstable/testing versus stable” divergence (the
former via daily builds and/or via an actual release), and once the hotfix
is confirmed and backported to stable, Pascal's MR can be merged on top of
it, and the hotfix can be phased out (at the same time or later, combining
both shouldn't hurt).


Does that make sense?


Cheers,

#1151671#74
Date:
2026-11-23 11:24:06 UTC
From:
To:
Hi Cyril,

Agreed, it seems worth the effort and added complexity to avoid the
change in behaviour in stable. FWIW, my preseeding setup would have been
broken by and needed adjustment for the "proper" fix.

It does to me. Happy to help test/review any changes.

I'll focus on completing the work on ca-certificates postinst to clean
up existing installations.

Best regards,
Max

#1151671#79
Date:
2026-11-23 12:00:58 UTC
From:
To:
Cyril Brulebois <kibi@debian.org> (2026-11-23):
working tree, and that's trivially massaged into what we need.

Please find attached two patches:
 - debian-installer.patch generates a list of certificate filenames out
   of the udeb's .list file; focusing on *.crt is sufficient as that's
   what getting copied to /target (no need to deal with symlinks,
   c_rehash, etc. as far as I can tell).
 - base-installer.patch consumes that list if it exists, logs deletions
   and executes update-ca-certificates if there are any deletions.

Building a netboot-gtk image with the first patch (plus those found in
the kibi/trixie-proposed-updates branch to give me a little preseeding
flexibility[*], using my own repository and my own signing key), then
preseeding the URL to a local repository that contains all trixie udebs
plus base-installer modified with the second patch… seems to yield the
desired results.

(a) The following means we use the unmodified base-installer, and that
    results in 148 certificates under /usr/local/share/ca-certificates
    (current situation):

        mirror/protocol=https
        mirror/https/hostname=deb.debian.org
        mirror/https/directory=/debian
        mirror/udeb/https/hostname=deb.debian.org [*]

    I wasn't expecting any surprises here (shipping an extra file…), the
    goal was mainly confirming I was able to reproduce the current issue
    and use it as a comparison point.

(b) The following means we use the modified base-installer, and that
    results in a log line that mentions the 148 deletions, in an empty
    /usr/local/share/ca-certificates directory, and also confirmation
    ca-certificates.crt was refreshed (which matters every time
    ca-certificates drops certificates after the installer was built):

        mirror/protocol=https
        mirror/https/hostname=deb.debian.org
        mirror/https/directory=/debian
        mirror/udeb/https/hostname=apt.debamax.com [*]

    For the avoidance of doubt, full syslog output:

        # tail /var/log/installer/syslog
        Nov 23 11:39:34 finish-install: info: Running /usr/lib/finish-install.d/90base-installer
        Nov 23 11:39:34 finish-install: I: deleted 148 official certificates
        Nov 23 11:39:34 finish-install: Updating certificates in /etc/ssl/certs...
        Nov 23 11:39:35 finish-install: rehash: warning: skipping ca-certificates.crt, it does not contain exactly one certificate or CRL
        Nov 23 11:39:35 finish-install: 148 added, 0 removed; done.
        Nov 23 11:39:35 finish-install: Running hooks in /etc/ca-certificates/update.d...
        Nov 23 11:39:35 finish-install: done.
        Nov 23 11:39:35 finish-install: info: Running /usr/lib/finish-install.d/90console
        Nov 23 11:39:35 finish-install: info: Running /usr/lib/finish-install.d/94random-seed
        Nov 23 11:39:35 finish-install: info: Running /usr/lib/finish-install.d/94save-logs

What do people think?


<disclaimer>

Building and testing restricted to the following so far (manual build of
a single target, with all components from trixie), but assuming we go
ahead with this proposed plan, we'll get more exposure via daily builds
soon enough.

    make -C build rebuild_netboot-gtk USE_UDEBS_FROM=trixie

</disclaimer>


Cheers,