Requiring 2FA to Publish to Crates.io

Why not simply use the hash value of a crate. After reviewing that crate, the name+version and hash value is added to a whitelist. Such a system could be distributed, many people would reviewing crates independently and one could compute the intersection of whitelists. Or people could link to whitelists they trust, building a web of trust. Furthermore a factor could be stated, indicating how much someone trusts a certain crate or whitelist.

The pros is ultimate security. The cons is complications during development and debugging.

2 Likes

hmm. a blockchain with a block algorithm that only accepts crates.io-signed blocks and refuses to replace packages/versions would solve the MITM problem I think. without being power-hungry and without 51% attacks. altho itā€™s still hackable.

A simpler alternative to a blockchain is a transparency log like Certificate Transparency. Mozilla has done some work on applying this to the problem of binary transparency here:

https://wiki.mozilla.org/Security/Binary_Transparency

I found this article unhelpful. While Stufft observes a number of real challenges in the space, at the root thereā€™s a very common philosophy: ā€œif it canā€™t be perfect, itā€™s not worth it.ā€ They donā€™t present a solution, or argue that there isnā€™t a problem to solve.

Contemporary with this article was the beginning of TUF, which was being developed specifically to address the Python infrastructure - which is a bigger challenge, IMO, than Crates is. Since then, TUF has been adopted as the foundation of Docker Notary. Itā€™s a solid approach that might be able to be applied wholesale.

Yeah, he didn't know about TUF at the time he wrote it, and later remarked that TUF addresses enough problems that it's actually worth it:

https://twitter.com/dstufft/status/699324070790352897

Oh wow. Now that Iā€™ve studied TUF a little bit, I think itā€™s amazing. Thanks for bringing it up, Iā€™ve learned something really cool ^^

Coming back to the conversation: I think TUF might be a really good option. It assumes there will be compromise of keys, and works to mitigate whatever impact that could have. Thatā€™s really awesome.

If anyone wants to check TUF out, Iā€™d recommend this video, which helped me a lot to really get the system.

2 Likes

In case you missed it, there's an open proposal to add TUF to crates.io here:

I've also been discussing a "minimum viable TUF" here:

2 Likes

canā€™t you just MITM that? what stops someone from MITMing that?

What stops someone from MitMing a CT log? CT logs are designed to be cryptographically verifiable (indeed the main use case is verifying X.509 certificates prior to opening TLS connections).

It carries a digital signature (i.e. a Signed Tree Head, or STH). To verify something is included in the log you need an inclusion proof (i.e. fragment of a Merkle tree) which is ultimately rooted in an STH. If there isn't an inclusion proof for a particular binary, it isn't trusted.

You can read more here:

okay, so itā€™s basically equivalent but with single points of failure.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.