Nightly PyTorch builds compromised
At around 4:40pm GMT on December 30 (Friday), we learned about a malicious dependency package (torchtriton) that was uploaded to the Python Package Index (PyPI) code repository with the same package name as the one we ship on the PyTorch nightly package index. Since the PyPI index takes precedence, this malicious package was being installed instead of the version from our official repository. This design enables somebody to register a package by the same name as one that exists in a third party index, and pip will install their version by default.This malicious package has the same name torchtriton but added in code that uploads sensitive data from the machine.
Posted Jan 2, 2023 16:29 UTC (Mon)
by pbonzini (subscriber, #60935)
[Link] (2 responses)
Posted Jan 2, 2023 17:45 UTC (Mon)
by khim (subscriber, #9252)
[Link]
It's nightly build, they were experimenting, I guess. And weren't sure if they want it or not in stable release.
Posted Jan 2, 2023 18:08 UTC (Mon)
by SLi (subscriber, #53131)
[Link]
Posted Jan 2, 2023 19:29 UTC (Mon)
by bluca (subscriber, #118303)
[Link] (13 responses)
Posted Jan 3, 2023 9:34 UTC (Tue)
by oldtomas (guest, #72579)
[Link] (10 responses)
Instead you'll get colourful fireworks on how to fix a social problem with technical means :-)
Happy New Year!
Posted Jan 4, 2023 1:03 UTC (Wed)
by bluca (subscriber, #118303)
[Link] (1 responses)
Posted Jan 11, 2023 5:34 UTC (Wed)
by oldtomas (guest, #72579)
[Link]
Posted Jan 5, 2023 7:48 UTC (Thu)
by groshu (subscriber, #113270)
[Link] (7 responses)
Posted Jan 5, 2023 8:38 UTC (Thu)
by Wol (subscriber, #4433)
[Link] (6 responses)
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 ...
Cheers,
Posted Jan 5, 2023 13:41 UTC (Thu)
by mathstuf (subscriber, #69389)
[Link] (5 responses)
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.
Posted Jan 5, 2023 15:01 UTC (Thu)
by farnz (subscriber, #17727)
[Link] (2 responses)
I've experienced places in the US refusing service for alcohol because my colleague's passport was clearly fake, since passports are blue and have the word passport on them, whereas his was red and had the "obviously misspelt" word passeport on it.
Posted Jan 5, 2023 22:28 UTC (Thu)
by Wol (subscriber, #4433)
[Link] (1 responses)
35 years ago, a colleague told me stories of his time in Texas. I believe America had plastic licences even then ...
Anyways, the police stopped him and asked for his licence, so he handed them a piece of green paper.
"What's this!?"
Cheers,
Posted Feb 25, 2023 15:45 UTC (Sat)
by nix (subscriber, #2304)
[Link]
(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...)
Posted Feb 7, 2023 16:56 UTC (Tue)
by JanC_ (guest, #34940)
[Link] (1 responses)
… and then being surprised that the whole setup is confusing, error prone, easy to falsify, and raising suspicion?
Posted Feb 7, 2023 19:25 UTC (Tue)
by mathstuf (subscriber, #69389)
[Link]
Posted Jan 3, 2023 15:46 UTC (Tue)
by ballombe (subscriber, #9523)
[Link] (1 responses)
Posted Jan 3, 2023 20:06 UTC (Tue)
by mathstuf (subscriber, #69389)
[Link]
Posted Jan 2, 2023 22:00 UTC (Mon)
by NightMonkey (subscriber, #23051)
[Link] (6 responses)
Posted Jan 3, 2023 7:22 UTC (Tue)
by ms (subscriber, #41272)
[Link]
Posted Jan 3, 2023 9:32 UTC (Tue)
by kleptog (subscriber, #1183)
[Link] (3 responses)
Python package repositories weren't created with an actual design, so this kind of thing wasn't really considered.
Posted Jan 3, 2023 20:07 UTC (Tue)
by mathstuf (subscriber, #69389)
[Link] (2 responses)
Posted Jan 3, 2023 21:37 UTC (Tue)
by anselm (subscriber, #2796)
[Link]
Posted Jan 4, 2023 7:56 UTC (Wed)
by auxsvr (guest, #120007)
[Link]
Posted Jan 3, 2023 16:14 UTC (Tue)
by SnoopJ (guest, #162807)
[Link]
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.
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.
[1] e.g. https://github.com/pypa/pip/issues/6045 and https://github.com/pypa/pip/issues/4263
Posted Jan 5, 2023 12:56 UTC (Thu)
by NAR (subscriber, #1313)
[Link] (4 responses)
Posted Jan 5, 2023 16:21 UTC (Thu)
by mbunkus (subscriber, #87248)
[Link] (3 responses)
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.
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.
Both apt & 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.
It's minimally harder to set up an APT/dnf repository than it is to provide a malicious shell script & a sudo-curl-bash one-liner. But there's no real security there.
Posted Jan 6, 2023 14:04 UTC (Fri)
by mw_skieske (guest, #144003)
[Link] (1 responses)
see: https://man7.org/linux/man-pages/man5/yum.conf.5.html
however this is not really a solution if you don't trust the controlling instance of a remote package server.
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.
on the plus side for the attacker this might be much harder to detect for end users.
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.
I believe this option is ultimately not a security option but more of a bandaid against accidentally installing a package from a wrong repository.
Posted Jan 6, 2023 21:23 UTC (Fri)
by NYKevin (subscriber, #129325)
[Link]
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.
Posted Feb 7, 2023 17:24 UTC (Tue)
by JanC_ (guest, #34940)
[Link]
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
Wol
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
"A driving licence."
"How do I know it's a driving licence?"
"It says so. On the front. In big black letters."
Wol
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
2. Using driving licenses & other random things instead of proper standardized ID cards as identification
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
Using the internet during CI build is always dangerous.
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
[2] https://github.com/uranusjr/simpleindex
[3] https://github.com/devpi/devpi
Apart from the ubiquitous Nightly PyTorch builds compromised
curl ... | sudo
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 bash
package to the users?
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
Nightly PyTorch builds compromised
APT preferences Pin-Priority