• brucethemoose@lemmy.world
    link
    fedilink
    arrow-up
    12
    ·
    1 day ago

    It appears I wasn’t hit, though I easily could have been, as I installed some Rust-based Python packages recently.

    I keep telling myself I’m going to containerize more projects, but it’s getting ridiculous now… TBH, maybe more Linux distros need to operate on a more strict “containerize everything by default” principle, as this is going to keep happening.

    • BB_C@programming.dev
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      1 day ago

      It appears I wasn’t hit, though I easily could have been, as I installed some Rust-based Python packages recently.

      I easily could have been

      If you’re using good projects that have Cargo.lock checked in (should be about everyone nowadays), an do the right thing using --locked with cargo install, then not really, It wouldn’t have been easy.

      Unless both an upstream (auto-)merging a bot PR updating to the malicious version (bad), and you installing that upstream (spectacularly unlucky), happened to coincide within that 86 minutes the malicious crate was up (39 minutes if advisory-db was hit at any step), which is almost impossible, but more importantly, fully traceable and investigable at the ecosystem level. And if we are talking released versions only, then the upstream would have had to cut a release and publish it also within that window.

      But yes, this is a historic first, a malicious publishing of a real crate with real dependants.


      Edit: I checked all arrayref dependants, and no crate published within the compromised window. No crate explicitly depends on >=0.3.10 (forcing the malicious version). And no crate published after the incident (potentially indicating fixing an earlier mistake) except for a couple of no-name blockchain crates that don’t even have source repos.

      • brucethemoose@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        1 day ago

        Well that’s the thing that scares me; I installed some Python packages (via uv) that compile Rust code upon installation.

        I don’t know what they do, or how pip handles it. I had to go and dig, and figure out how they install packages and what the original projects use.

    • The would protect against malicious code running on the Dev’s computer (which AFAICT is the case here), but not against the code created using the infected library running on users’ computers. And honestly, seeing the regularity of supply chain attacks in recent times, I think we need to find a better way to work with supply chains going forward. Although I admittedly don’t have any solutions myself, tbh.

      • moonpiedumplings@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        18 hours ago

        The model of stable Linux distros, particularly Red Hat, Debian, and Ubuntu is impressive in that they only ship cherry picked security updates, and don’t ship general updates overall, often even forgoing bugfixes. They are extremely resilient against supply chain attacks.

        The XZ utils backdoor, for example, did not make it into either of those three distros. That’s why I hate when it’s compared to programming langauge specific supply chain attacks, because there is a big different. With Debian/RHEL, you have 4+ years to catch a supply chain issue, rather than whatever your dependency cooldown is.

        And then, the lack of any non-security changes means that the system behavior is stable enough to base software on it that automatically receives security updates to libraries it is using.

        This is why enterprises like RHEL so much. For so many institutions, manually managing updates is a cost they are unwilling to, or straight up unable to handle. The idea of manually doing updates, or bypassing cooldowns in order to get a fix for some critical CVE, is way more expensive than it’s worth at scale, especially for institutions that aren’t going to actively take advantage of new features, like so many slow moving government entities or so many non tech focused corporations.

        I like the model of Rust, and believe it is the future of systems programming, but I am intensely frustrated with the way it is tied to an ecosystem that is extremely sloppy about supply chain security. The Linux kernel and Firefox may use Rust, but they don’t actually use the Rust ecosystem, they copy all crates they use into their own tree, and then cherry pick and review changes, or maintain the software themselves entirely. All Rust code Linux/Firefox use is owned by themselves, although I think that such a model is only possible due to the development resources they have.

        • unknownuserunknownlocation@kbin.earth
          link
          fedilink
          arrow-up
          1
          ·
          13 hours ago

          I’m still talking about programming language specific supply chain attacks, I’m just talking about those where the malicious code targets the user’s computer. Especially in a language like rust where everything is linked statically, a simple update of a library can bring in malicious code, and generally a change such as “updated library X to Y.Z” will not be analyzed as slowly as code changes from the project itself. And while I personally prefer the concept of stable distros, the whole concept of stable distributions is that the software was used for an extended period of time before that, and you don’t want those users getting malware, either - so that’s not really the solution to the problem IMO.

          • moonpiedumplings@programming.dev
            link
            fedilink
            English
            arrow-up
            1
            ·
            6 hours ago

            the whole concept of stable distributions is that the software was used for an extended period of time before tha

            Not quite, the whole concept of these ultra stable distros is that they take a version of the software, and essentially pin, it, cherrypicking mostly, or only security changes as updates. The version of the software that is selected, can be, and usually is from a much newer version of the software overall.

            Because of this, Debian and Ubuntu have an interesting pattern, where each one doesn’t universally have older packages than the other. Instead, a new Debian release comes out, it has newer packages, then a new Ubuntu release comes out, and they alternate.

            Anyway, during the process of releasing a new stable distro, the programs are libraries are assessed, and then tested a bit before being included. In theory, if you had enough manpower, and you were fast enough, you could probably pin close to the current latest version of things, and then have those in your stable distro, even if they have only been out for a short period of time.

            The idea of “program version has been released for 2 years, now let’s include them into a stable distro”, is not how they actually work. Instead, the pinning and then security updates model, deduplicates a lot of work, because now you only assess the security and quality of the programs to be packaged once, instead of continuously every single update.

            It’s not about eliminating bugs by using well tested programs. Stable distros are about ensuring the stability of the behavior of the system. The same set of, of predictable bugs, rather than a constantly changing set of them.

            If you use a stable distro as your programming language supply chain, you essentially don’t have to deal with security updates in dependent libraries, or worry about supply chain security. Any dynamically linked language is able to do this, but my frustration with Rust is that this is not an option, which is something I really hope changes in the future.

      • brucethemoose@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        1 day ago

        pretty specific baremetal requirements

        I do, for some things, unfortunately.

        I think Firejail or good old systemd sandboxing would be massive improvements though; I just need to invest the energy in setting them up.