News for hackers. Stuff that matters.
Re:Backdooring Rust crates for fun and profit by kibwen on Thursday November 18, 2021 @01:01PM (#29268413)
I am a mild proponent of namespaces. But adding them means you are now managing an identity layer, which is not something that a volunteer organization wants to deal with. In a flat namespace, users don't expect that a google-foo library is actually from Google. But with namespaces, people expect that everything under the google/ namespace actually is officially supported by Google. So when the initial rush to register names happens, who verifies that Google owns the google/ namespace? And not just for Google, but for every litigous trademark-defending organization under the sun? And since the package repository is supposed to be immutable, you don't want to wantonly delete crates from namespaces that they originally registered. Likewise, you can't go transferring ownership of a namespace from one entity to another, because that violates the security assumptions of your users who originally trusted the original owner of the namespace and not the new owner.

Identity layers are hard. It's a problem worth solving, but it's not going to happen on a volunteer basis. It needs full-time paid employees to deal with this. Perhaps the Rust Foundation will make such a thing a priority.

Re:Backdooring Rust crates for fun and profit by brabel on Thursday November 18, 2021 @01:09PM (#29268519)
These problems you raise have been solved problems for a long time.

Maven Central uses verified reversed domain names, so to own `com.google` you need to prove you own the domain `google.com`. It's not hard to do it.

Dart's pub does the same thing with verified publishers.

crates.io already requires user accounts from publishers, so it already manages identity.

The only reason they don't require namespaces is to make crate names look cooler and the barrier to entry non-existen, so they can amass large numbers of packages in a short time (then deal with the fallout only when it becomes an emergency), I can't see any other reason anywhere, including from the ones you've raised.

Re:Backdooring Rust crates for fun and profit by kibwen on Thursday November 18, 2021 @01:32PM (#29268765)
> crates.io already requires user accounts from publishers, so it already manages identity.

It currently requires a Github account, but the registry is not tightly coupled to Github. But once you introduce Github identities as something that code is explicitly depending on, now you're at the mercy of Github for the rest of time. Furthermore, immutability is a desirable property of package registries, and Github identities are not immutable; Github allows people to change their usernames and then allows any random person to snap up the old username.

> The only reason they don't require namespaces is to make crate names look cooler and the barrier to entry non-existen, so they can amass large numbers of packages in a short time

No, this is needlessly conspiratorial. Please exercise some perspective. crates.io is run by volunteers, and managing an immutable identity layer is not something that the current crop of volunteers wants to commit to.

Re:Backdooring Rust crates for fun and profit by teddyh on Thursday November 18, 2021 @01:25PM (#29268703)
When (not if) a domain name expires or changes ownership, how is this detected and the connection re-verified?
Re:Backdooring Rust crates for fun and profit by brabel on Friday November 19, 2021 @05:52AM (#29275903)
It's interesting people like to bring this up because this is also a non-issue as a publisher needs to provide PGP keys... if the domain expires and someone else takes it over, their PGP keys will be different and it's up to users to decide whether to trust those...

When a domain changes hands, it's also up to users to decide whether to trust the new owner's TLS certificate... I am saying this because this is forms the basics of Internet security, when people bring this argument up, they show a certain ignorance of how things work on the Internet in general.

Re:Backdooring Rust crates for fun and profit by teddyh on Friday November 19, 2021 @10:22AM (#29278080)
Saying it’s “up to users to decide whether to trust those” is simply saying that the problem is currently not solved. I mean, either the package is tethered to a domain name or a PGP key. Pick one.

You can, of course, have both, if you use DNSSEC and DNS “PGP” records; the PGP key is then validated by the DNS.

Re:Backdooring Rust crates for fun and profit by brabel on Friday November 19, 2021 @02:22PM (#29281138)
> Saying it’s “up to users to decide whether to trust those” is simply saying that the problem is currently not solved.

Again, Internet security is mostly based on trust and there's no way around that: when you enter a URL on a browser, you need to trust that the domain belongs to who you think it belongs, and the only way you have to do that is to trust its TLS certificate... which you do by explicitly trusting your browser to only recognize reliable TLS certificates signed by a legit root certificate authority... unless you decide to whitelist TLS certificates yourself by obtaining the domain's root certificates out-of-band, something nobody seems to think necessary to do, even the most security-conscious government agencies probably go to that kidn of trouble.

Basing package ownership on the same kind of mechanism is the best you can ever do... if you consider that as not being a good enough solution, then you should never use the internet with consumer-grade browsers at all, let alone use package managers in any form.

Re:Backdooring Rust crates for fun and profit by teddyh on Friday November 19, 2021 @11:38PM (#29285600)
Describing the current CA system for TLS certificates as the peak of what is currently possible is simply untrue. As it happens, there is a solution, and I described it. Domain names can be tied to a strict key hierarchy using DNSSEC, and DNS for domains can in turn contain PGP keys (or any other kind of verification data). This way, a package could be directly verified as being issued by a current owner of a domain name.

The fact that we all use and trust CA-issued certificates today is not an argument for accepting that system as the best we could ever do in the future, or even today. And the fact that one wishes to improve the current situation does not make it wrong to use the current system as it is – to claim otherwise is to be Mister Gotcha (https://thenib.com/mister-gotcha/).