12 comments

  • iamnothere 28 minutes ago
    Bonus, the man in the middle can see what packages you’re downloading since you’re not using HTTPS, so they know if you’re vulnerable during an update.

    I never understood the insistence on using HTTP as a default for apt. Once HTTPS transport was available and tested (which took forever btw) then it should have become the default. Maybe this will spur some changes.

    • ducktective 19 minutes ago
      How to cache with HTTPS?
      • Avamander 13 minutes ago
        If your scale actually makes caching worth it you can run a local HTTPS mirror. If you don't control the endpoints to do that, you don't get to MiTM anything.
      • sznio 10 minutes ago
        give the cache server a certificate?
      • iamnothere 16 minutes ago
        SSL bumping
  • Avamander 18 minutes ago
    Not surprised at all. I remember all of the heated discussions (even here on HN) around there being absolutely no need for HTTPS because "everything is signed with PGP".

    Exposing all of the internals of something to any and all MITM keeps on demonstrating how it's a dangerous idea.

    Hopefully this example settles at least some of this pointless discussion.

  • vesinisa 1 hour ago
    No word as of yet if Ubuntu's apt is also impacted.

    Sounds like the vulnerability is in the HTTP handling code, and because apt downloads packages over plain HTTP a man-in-the-middle position would be enough to exploit it.

    It almost seems like a repeat of two previous apt vulnerabilities:

    In 2019: https://lists.debian.org/debian-security-announce/2019/msg00...

    And in 2014: https://lists.debian.org/debian-security-announce/2014/msg00...

    • angry_octet 1 hour ago
      Despite with the 'no need for TLS, apt packages are signed' clowns would have you believe, you can usually point to a package mirror with https. This has the added advantage of preventing a mitm from knowing what packages you install or blocking selected packages.
      • InsidiousWombat 52 minutes ago
        well when CA use 4 as key that kinda matters less
      • anthk 1 hour ago
        Every mirror will know that because of HTTPD logs.
        • DaSHacka 32 minutes ago
          In fairness to GP, that wouldn't be a man in the 'middle', the mirror is the end destination for your traffic.
    • greggsy 1 hour ago
      I thought there might be some kind of hash or signature, but I’m assuming that can be forged along with the main payload?
      • vesinisa 1 hour ago
        From the short description in the advisory, would seem like the attacker can cause the tool to overwrite the file after signature verification.
      • TZubiri 48 minutes ago
        Of course not, Debian is one of the most robust pieces of software around. They wouldn't do something idiotic like relying on the hash being sent with the payload through the same channel.

        I think the idea is that debian distributes the hash themselves through their domain, and mirrors offer the downloads either through http or https. So that you don't need to trust the mirror, you just verify the debian given hash. Only weakness would be a hash collision or a cve like this.

        • DaSHacka 23 minutes ago
          AFAIK this isn't actually true for any distribution. This would break selfhosted mirrors and their clients hosted on airgapped networks, and create a single point of failure for users.

          The way packages are validated actually is through the same channel as you download the packages themselves from (IE your mirror), they just are signed with the Debian package signing key(ring), of which only a select few maintainers have authorized private keys for.

          This does mean an adversary (whether a MITM if you're using HTTP or malicious operator on the mirror server itself) can technically serve you old versions of an (officially signed) package indefinitely and your package manager would be none the wiser, but otherwise this approach actually works quite well.

  • londons_explore 9 minutes ago
    And APT was the one being very reluctant about using HTTPS because "we sign out stuff so don't need encryption".

    I think this demonstrates exactly why everything should be https.

    • teddyh 5 minutes ago
      HTTPS will not protect you from a bad/compromised mirror.
      • Avamander 3 minutes ago
        A bad mirror is much less likely than someone MiTMing, at least for most machines.
  • greggsy 1 hour ago
    > We recommend that you upgrade your apt packages.

    Is there a German word for a broken tool that can only be fixed by using the same broken tool?

    • ahofmann 1 hour ago
      Well, of course there is "Selbstreparaturparadoxon", but nobody uses that. This is more like a Münchhausen-Problem, where Baron Münchhausen pulls himself out of the swamp by his own hair.
    • veeti 57 minutes ago
      For what it's worth there is an apt "Acquire::http::AllowRedirect" option that can be disabled.
      • hackyhacky 15 minutes ago
        > For what it's worth there is an apt "Acquire::http::AllowRedirect"

        Odd, I am not familiar with that that German word.

    • pllbnk 1 hour ago
      Münchhausenwerkzeug.
  • serbuvlad 59 minutes ago
    It's always been strange to me and I've been saying forever that I don't get why package repos don't use HTTPS.
    • krautsauer 37 minutes ago
      Easier to put caching proxies on the path?
      • Avamander 18 minutes ago
        Who actually does that this day and age?
    • basilikum 33 minutes ago
      It's not the default, but you can install apt-transport-https and then just change the update URLs to https assuming your mirror supports that.
    • MiscIdeaMaker99 17 minutes ago
      I would speculate that it's inertia due to decisions made a decade or two ago, before we decided that everything should run via HTTPS.
    • InsidiousWombat 55 minutes ago
      theoretical model means that the transfer method doesn't matter.

      Of course, that breaks if implementation checks the signatures in wrong moment

      • vesinisa 39 minutes ago
        There have already been quite a few vulnerabilities in the implementation that would have been avoided if the transport itself was simply protected in line with the industry standard practice of using TLS by default.
    • ferngodfather 55 minutes ago
      I get it to a point because it can be a chicken and egg situation sometimes, but there has got to be a better way.
  • flotzam 55 minutes ago
    Would it have killed them to give even a little bit of guidance how to securely update the apt package(s)?

    If necessary, with instructions for downloading and verifying it out of band

    Or maybe by passing a parameter to the old apt that disables the vulnerable HTTP download resumption when downloading the new apt

    • TZubiri 51 minutes ago
      Use https?
      • flotzam 47 minutes ago
        Still places trust in the download servers, which makes them a juicy target

        But yes, they could have mentioned HTTPS to make the announcement at least half-assed. Even just saying "good luck not getting exploited" would be an improvement over literally nothing

  • hypfer 36 minutes ago
    If I understand correctly, trixie-security contains a fixed version, however, bookworm not (yet)?

    Is it going to be fixed for oldstable?

  • hiddenvulkcan 1 hour ago
    Yikes, that vuln in apt is pretty bad! I think a lot of the newer wave of vulnerabilities being found generally seem to have a low likelihood of being reached, but this seems somewhat plausible? I'm assuming this would be done by compromising a mirror, in order to do the redirect?
    • bradfa 1 hour ago
      More likely just a man in the middle attack. Apt typically uses HTTP (no TLS) as the signatures give the security. But in this case it sounds like the vulnerability is that after a successful signature check the legit file can be overridden by the attacker through some HTTP shenanigans.
      • hiddenvulkcan 46 minutes ago
        Well, at least it's Debian, so even if they used HTTPS they'd still be vulnerable!

        I didn't know that about apt, interesting choice!

    • TZubiri 40 minutes ago
      It's not 'Attack Vector: Network' in cvss, so it's probably scoring lower than a 7.

      EDIT: With 'AV:Adjacent Network' and A 'User Interaction: Required' and max impact (High on Confidentiality, Integrity and Availability, assuming worst case), then it gets a score of 8.

      The subjectives lower the severity to my eyes as well, including the use of HTTP mirrors (which is the default notwithstanding), and the attacker needing to be an existing mirror at the time of the announcement, which is already a vetted group (or be in the path between the user and the mirrors, umm that is quite possible though, but quite hard to target). And finally the window for the disclosure and attacks is almost null, someone needs to use apt to be vulnerable, but if they use apt, they are probably autoupdating apt itself, I wonder if a simple 'apt install thing' will trigger an apt upgrade, in order to patch those that are not running autoupgrades.

      • RagingCactus 31 minutes ago
        Nitpick about CVSS scoring:

        I always strongly argue against framing MITM scenarios as AV:Adjacent as MITM attacks can be performed at any point of the transmission path. If someone MITMs the package mirror the attacker is certainly not adjacent to the vulnerable component. I argue in favor of using Attack Complexity: High instead, as you do need to be in a MITM position.

        And while UI:Required could be argued, there are also unattended upgrades and updates are performed regularly anyway. CVSS 4 makes some progress here with UI active vs passive, but ultimately CVSS is often not helpful for capturing the unique risk of a vulnerability.

  • InsidiousWombat 55 minutes ago
    interesting, why is verification not running after package is already on hard drive in full ?
    • Karliss 31 minutes ago
      This is my best guess on what's happening based on the limited information linked.

      1) Apt downloads first package (unmodified)

      2) apt checks signature -> signature checked and remembered as valid

      3) apt downloads second package, http redirect to the same url as package 1

      4) the second package overwrite first one due to sharing URL. The temporary storage name or download cache key is derived from URL.

      5) signature for package 2 fails but first one (already overwritten by bad one) is still considered good

      6) Package 1 gets executed because the signature check already passed in step 2

      Note sure where exactly resuming an HTTP download fits in. Maybe step 4 also requires pausing and resuming the update process. Which could involve some state serialization/deserialization vulnerable to conflicting URL confusion.

    • justinsaccount 29 minutes ago
      based only on the wording in the notice:

      > APT can merge two different package downloads after an HTTP redirect gives them the same URI

      It sounds like the verification is ran but there is some deduplication or caching involved keyed on the destination of the url redirect, not the original source.

      So could imagine a malicious server that:

      Responds for a request for foo.deb with a redirect to evil.deb containing the original foo.deb. This validates properly.

      Responds with a second request for bar.deb with a redirect again to evil.deb that now returns a malicious package. The downloading code thinks it has already validated evil.deb

  • mariofdistrust 1 hour ago
    yey, my computers and containers aren't vulnerable (^-^)
  • 12312987 1 hour ago
    Debian is such a clown show. The SSL fiasco, apt over http, overpatching packages, allowing AI, kicking out packages over some lintian bullshit.

    How are you going to update if apt is compromised?

    • teddyh 37 minutes ago
      I’ll just note that you had to go back more than 20 years to get that short list of complaints.
    • throwaway74354 53 minutes ago
      >How are you going to update if apt is compromised?

      Download the package with your http client of choice, install with sudo dpkg --verify -i

    • InsidiousWombat 54 minutes ago
      many mirrors are also available over https, you can just change that
      • DaSHacka 16 minutes ago
        Basically all of them are, many of the larger mirror servers host multiple distributions, with some defaulting to/requiring HTTPS nowadays anyway.
    • qwert199 1 hour ago
      [flagged]