LWN: Comments on "Nightly PyTorch builds compromised" https://lwn.net/Articles/918884/ This is a special feed containing comments posted to the individual LWN article titled "Nightly PyTorch builds compromised". en-us Sat, 04 Oct 2025 10:06:10 +0000 Sat, 04 Oct 2025 10:06:10 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Nightly PyTorch builds compromised https://lwn.net/Articles/924428/ https://lwn.net/Articles/924428/ nix <div class="FormattedComment"> That of course assumes they can read whatever language the words are written in. I might point here at the tale of the most nefarious driving offender in Ireland, a protean master of disguise whose appearance was never the same twice, a Mr. Prawo Jazdy: &lt;<a href="http://news.bbc.co.uk/1/hi/northern_ireland/7899171.stm">http://news.bbc.co.uk/1/hi/northern_ireland/7899171.stm</a>&gt;.<br> <p> (Lest anyone think this is a joke about the Irish, it was of course an English (Welsh border) council which managed the impressive trick of putting up dual-language Welsh road signs where the Welsh "translation" was the Welsh for "I am out of the office at the moment but will be back on Monday." You'd think they could have at least spotted that the day of the week was in the translation but not the original and that something *must* be wrong, but nooo...)<br> </div> Sat, 25 Feb 2023 15:45:00 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/922543/ https://lwn.net/Articles/922543/ mathstuf <div class="FormattedComment"> RealID is (supposed) to fix at least a baseline of things. However, the requirement date keeps getting pushed back further and further…<br> </div> Tue, 07 Feb 2023 19:25:22 +0000 APT preferences Pin-Priority https://lwn.net/Articles/922539/ https://lwn.net/Articles/922539/ JanC_ <div class="FormattedComment"> You can use an origin-based Pin-Priority (see apt_preferences(5) for how this works) to prevent this.<br> </div> Tue, 07 Feb 2023 17:24:28 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/922537/ https://lwn.net/Articles/922537/ JanC_ <div class="FormattedComment"> 1. Allowing every state &amp; territory &amp; colony of the US to issue its own completely different &amp; incompatible driving license<br> 2. Using driving licenses &amp; other random things instead of proper standardized ID cards as identification<br> <p> … and then being surprised that the whole setup is confusing, error prone, easy to falsify, and raising suspicion?<br> </div> Tue, 07 Feb 2023 16:56:24 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/919598/ https://lwn.net/Articles/919598/ oldtomas <div class="FormattedComment"> Glad to see there are some exceptions to our expectation :)<br> </div> Wed, 11 Jan 2023 05:34:30 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/919273/ https://lwn.net/Articles/919273/ NYKevin <div class="FormattedComment"> <span class="QuotedText">&gt; i.e. if ms vs code repo content or their signing get somehow compromised they can just replace the "code" binary which you maybe want from this repository to include malicious content.</span><br> <p> I doubt this is a solvable problem. You have to trust *somebody* (unless you want to download all of the source code and audit it by hand, in which case you should probably be using Gentoo instead of Debian), and in practice that probably has to be the packager, not the upstream (because the packager may have to carry patches or otherwise modify the software to be suitable for distribution). If you trust the packager, then you trust them, end of story. If you don't trust them, then you can't (shouldn't) run any software they give you.<br> </div> Fri, 06 Jan 2023 21:23:40 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/919190/ https://lwn.net/Articles/919190/ mw_skieske <div class="FormattedComment"> you can "harden" specifc package repo files on fedora/rpm distros with the option "includepkgs" which will only download the listed packages from that repo and ignore everything else from that URL.<br> <p> see: <a href="https://man7.org/linux/man-pages/man5/yum.conf.5.html">https://man7.org/linux/man-pages/man5/yum.conf.5.html</a><br> <p> however this is not really a solution if you don't trust the controlling instance of a remote package server.<br> <p> i.e. if ms vs code repo content or their signing get somehow compromised they can just replace the "code" binary which you maybe want from this repository to include malicious content.<br> <p> on the plus side for the attacker this might be much harder to detect for end users.<br> <p> fwiw the official ms package for fedora does not automatically set these restrictions and I'm not aware of many repositories that do something like this.<br> <p> I believe this option is ultimately not a security option but more of a bandaid against accidentally installing a package from a wrong repository.<br> </div> Fri, 06 Jan 2023 14:04:12 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/919166/ https://lwn.net/Articles/919166/ Wol <div class="FormattedComment"> Things don't change, do they ... :-)<br> <p> 35 years ago, a colleague told me stories of his time in Texas. I believe America had plastic licences even then ...<br> <p> Anyways, the police stopped him and asked for his licence, so he handed them a piece of green paper.<br> <p> "What's this!?"<br> "A driving licence."<br> "How do I know it's a driving licence?"<br> "It says so. On the front. In big black letters."<br> <p> Cheers,<br> Wol<br> </div> Thu, 05 Jan 2023 22:28:01 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/919141/ https://lwn.net/Articles/919141/ mbunkus <div class="FormattedComment"> This would most likely work just fine. When you add such a repository, be it an APT repo for Debian-based systems or an RPM repository for RPM-based distros such as Fedora/RHEL/openSUSE, you pretty much always add a GPG key that the repo signs it package lists (APT repos) or the packages themselves (RPM packages) with to the list of trusted GPG keys. See e.g. installation instructions on my MKVToolNix home page at <a href="https://mkvtoolnix.download/downloads.html#debian">https://mkvtoolnix.download/downloads.html#debian</a><br> <p> Then it's just a matter of adding a package called "bash" with a slightly higher version number to that repository, and a subsequent manual package upgrade should pick it up.<br> <p> That being said, it will likely not be installed automatically. In the Debian-based world there's the "unattended-upgrades" mechanism/package that takes care of installing updates automatically. However, it's pretty much always configured to only download updates from specific APT sections (e.g. from the "security" section). Though I'm not sure how easy it is to fake it.<br> <p> Both apt &amp; dnf will show where packages are downloaded from; therefore you might spot that "bash" is coming from a server you don't necessarily expect it from. It might also just be overlooked if the number of downloaded packages is big.<br> <p> It's minimally harder to set up an APT/dnf repository than it is to provide a malicious shell script &amp; a sudo-curl-bash one-liner. But there's no real security there.<br> </div> Thu, 05 Jan 2023 16:21:34 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/919114/ https://lwn.net/Articles/919114/ farnz <p>I've experienced places in the US refusing service for alcohol because my colleague's passport was clearly fake, since <a href="https://en.wikipedia.org/wiki/United_States_passport#/media/File:Us-passport.jpg">passports are blue and have the word passport on them</a>, whereas his was <a href="https://en.wikipedia.org/wiki/French_passport#/media/File:Passeport_%C3%A9lectronique_fran%C3%A7ais.jpg">red and had the "obviously misspelt" word passeport on it</a>. Thu, 05 Jan 2023 15:01:10 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/919097/ https://lwn.net/Articles/919097/ mathstuf <div class="FormattedComment"> There's still a level of problem with the former (well, at least when there's insufficient training). My state had very bendable and almost rubbery licenses for a time and people from far-away states were very suspicious of it. They're better now and have some interesting features in them (the transparent hologram window still confuses some people, but it is far better than the older style).<br> <p> There's also the story of a grocery store in some Midwest state denying a Washington DC license because "DC isn't a state, how can they have driver licenses?" until the police showed up and said "no, this is fine". I recall hearing of disbelief in diplomatic passports as well.<br> </div> Thu, 05 Jan 2023 13:41:31 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/919096/ https://lwn.net/Articles/919096/ NAR Apart from the ubiquitous <code>curl ... | sudo</code> instructions there are also instructions around to add third party repositories (sometimes the addition of the third party repository is itself bundled in a package). What would happen if such third party repository would try to give e.g. a malicious <code>bash</code> package to the users? Thu, 05 Jan 2023 12:56:34 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/919091/ https://lwn.net/Articles/919091/ Wol <div class="FormattedComment"> I think it's called "security theatre".<br> <p> It's the difference between hiring a company to provide a guy to check everyone's id, and employing a guy who recognises everyone's face ... night and day ...<br> <p> Cheers,<br> Wol<br> </div> Thu, 05 Jan 2023 08:38:26 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/919090/ https://lwn.net/Articles/919090/ groshu <div class="FormattedComment"> But isn't "fixing a social problem with technical means" a definition of the thing we call "security"?<br> </div> Thu, 05 Jan 2023 07:48:47 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/919026/ https://lwn.net/Articles/919026/ auxsvr <div class="FormattedComment"> poetry lock files contain hashes for all platforms, including tarballs.<br> </div> Wed, 04 Jan 2023 07:56:03 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/919019/ https://lwn.net/Articles/919019/ bluca <div class="FormattedComment"> Looking at the rest of the comments, seems like you were spot-on<br> </div> Wed, 04 Jan 2023 01:03:06 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/919011/ https://lwn.net/Articles/919011/ anselm <div class="FormattedComment"> IIRC you can list multiple acceptable hashes per package.<br> </div> Tue, 03 Jan 2023 21:37:48 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/919000/ https://lwn.net/Articles/919000/ mathstuf <div class="FormattedComment"> How's the hash matching work when each platform/version has its own wheel? Or is this yet another wheel feature that is only really supported if you are pure Python?<br> </div> Tue, 03 Jan 2023 20:07:19 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/918999/ https://lwn.net/Articles/918999/ mathstuf <div class="FormattedComment"> Well, the Internet without verified downloads (hash and/or GPG) at least. Lock files would have helped a lot here I imagine.<br> </div> Tue, 03 Jan 2023 20:06:10 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/918983/ https://lwn.net/Articles/918983/ SnoopJ <div class="FormattedComment"> There isn't much in the way of control of precedence in pip, unfortunately. It's a requested feature [1] but there has been relatively litttle work to make it work. PyPA does define a standard (.pypirc) for configuring indexes that gives very good control over precedence, but pip has zero support for it (honestly I don't know what *does* support it)<br> <p> The gold standard (imo) for avoiding this kind of mistake is to set up your own index that is capable of falling back onto PyPI, and use `--index-url` instead. One of the pip maintainers publishes the tool `simpleindex` [2] for doing this, letting you specify explicitly which packages you want from your own index, and falling back to PyPI for the rest. There's also `devpi` [3] but it's substantially more complicated to operate.<br> <p> Honestly, it feels like a huge mistake for pip to keep the `--extra-index-url` feature. It's hard to use safely and I think a big reason that pip hasn't grown a better way to do it is because it's "good enough" if you're willing to overlook the massive attack vector it brings along for the ride with any internal packages.<br> <p> [1] e.g. <a href="https://github.com/pypa/pip/issues/6045">https://github.com/pypa/pip/issues/6045</a> and <a href="https://github.com/pypa/pip/issues/4263">https://github.com/pypa/pip/issues/4263</a><br> [2] <a href="https://github.com/uranusjr/simpleindex">https://github.com/uranusjr/simpleindex</a><br> [3] <a href="https://github.com/devpi/devpi">https://github.com/devpi/devpi</a><br> </div> Tue, 03 Jan 2023 16:14:10 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/918951/ https://lwn.net/Articles/918951/ ballombe <div class="FormattedComment"> What is interesting here is that it it seems the attackers have searched CI logs for that kind of situation...<br> Using the internet during CI build is always dangerous.<br> </div> Tue, 03 Jan 2023 15:46:04 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/918940/ https://lwn.net/Articles/918940/ oldtomas <div class="FormattedComment"> You won't get that.<br> <p> Instead you'll get colourful fireworks on how to fix a social problem with technical means :-)<br> <p> Happy New Year!<br> </div> Tue, 03 Jan 2023 09:34:33 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/918938/ https://lwn.net/Articles/918938/ kleptog <div class="FormattedComment"> Pip does allow matching on sha256sum and failing if it doesn't match. It's however not the default and not exactly user friendly either. There are other options controlling repositories but it's not very helpful.<br> <p> Python package repositories weren't created with an actual design, so this kind of thing wasn't really considered.<br> </div> Tue, 03 Jan 2023 09:32:04 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/918934/ https://lwn.net/Articles/918934/ ms <div class="FormattedComment"> Exactly. Having multiple repositories where the repository name does not prefix the namespace is pretty bonkers. Or better yet, there should be no central repository and just use URLs of each repo as the name. I.e. the Go design is basically right.<br> </div> Tue, 03 Jan 2023 07:22:56 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/918917/ https://lwn.net/Articles/918917/ NightMonkey <div class="FormattedComment"> I'd really like to know more about how to short-circuit the precedence rules in pip to avoid this. In general, I want no surprises in sourcing modules and libraries in any programming language. I'd like the option to try one source, have a md5sum or other hash to lock my dependency on, and fail if that isnt available when requested.<br> </div> Mon, 02 Jan 2023 22:00:35 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/918904/ https://lwn.net/Articles/918904/ bluca <div class="FormattedComment"> Looking forward to hearing again how language-specific package managers are the future and distributions as useless and obsolete.<br> </div> Mon, 02 Jan 2023 19:29:05 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/918897/ https://lwn.net/Articles/918897/ SLi <div class="FormattedComment"> Interesting. My first reaction was to question instead if any package should be pulled in from pypi that automatically.<br> </div> Mon, 02 Jan 2023 18:08:09 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/918892/ https://lwn.net/Articles/918892/ khim <p>It's nightly build, they were experimenting, I guess.</p> <p>And weren't sure if they want it or not in stable release.</p> Mon, 02 Jan 2023 17:45:06 +0000 Nightly PyTorch builds compromised https://lwn.net/Articles/918889/ https://lwn.net/Articles/918889/ pbonzini <div class="FormattedComment"> Why wasn't the package uploaded to PyPI in the first place?<br> </div> Mon, 02 Jan 2023 16:29:04 +0000