News for hackers. Stuff that matters.
Re:Crev: dependency vetting with a web of trust by pornel on Friday January 04, 2019 @11:50AM (#18825452)
Some background on this:

Cargo makes it very easy to add dependencies. Rust has the same culture of small, single-purpose libraries as npm (there is https://crates.io/crates/left_pad if you're wondering).

This of course raises the question: what if someone puts some malware in a crate? Cargo itself has an OK security (and working on more end-to-end integrity checks), so it's unlikely that someone will inject malware into existing crates, but that still leaves question of trusting the original crate authors.

Rust is not a sandbox language. Even the "safe" subset of the language is still just about preventing bugs, but nowhere near a watertight sandbox required to protect programmers and users from straight-up malware running in their own program. It's not clear if that is even possible in an efficient, low-level systems programming language.

So the most reasonable way forward is to ensure that all code you use is either from people you trust, or has been verified by you or someone you trust.

Turning code reviews into a shareable artifact is a pretty cool addition here, as it reduces duplication of work across the community (you don't have to review everything personally), and helps you pick and choose who you trust.

Re:Crev: dependency vetting with a web of trust by eridius on Friday January 04, 2019 @05:20PM (#18828258)
> Rust is not a sandbox language. Even the "safe" subset of the language is still just about preventing bugs, but nowhere near a watertight sandbox required to protect programmers and users from straight-up malware running in their own program.

Not only that, but even just the act of building a dependency is unsafe as dependencies can specify build scripts (which is just Rust code that's compiled and executed prior to building the crate).

Re:Crev: dependency vetting with a web of trust by nicoburns on Friday January 04, 2019 @12:59PM (#18826105)
I'm pretty sure the left-pad crate is a joke. That functionality is in the standard library...
Re:Crev: dependency vetting with a web of trust by tln on Friday January 04, 2019 @01:32PM (#18826436)
The only dependency of left_pad:

https://crates.io/crates/kik

"waiting for a takedown notice :P"

Re:Crev: dependency vetting with a web of trust by richardwhiuk on Friday January 04, 2019 @07:01PM (#18828936)
That's not a dependent on left pad, that's something which depends on left pad.
Re:Crev: dependency vetting with a web of trust by reindeerer on Saturday January 05, 2019 @02:55AM (#18830522)
Moxie Marlinspike came up with the concept of trust agility some time ago. I think it's imperative that the agility of the trust network is guaranteed, because this can be a fast changing situation.
Re:Crev: dependency vetting with a web of trust by stcredzero on Friday January 04, 2019 @07:29PM (#18829041)
Cargo makes it very easy to add dependencies. Rust has the same culture of small, single-purpose libraries as npm

This of course raises the question: what if someone puts some malware in a crate?

Do decentralized web of trust schemes actually work? What are the precedents? AFAIK, only centralized webs of trust work, and even those still leak around the edges and take some degree of active policing to defend. Basically, someone (or maybe a few competing someones) with authority establishes a canonical boundary and publishes a canonical list.

Re:Crev: dependency vetting with a web of trust by jake_the_third on Saturday January 05, 2019 @12:01AM (#18830002)
> only centralized webs of trust work

How can you claim that? Looking at most tech we have today, it becomes readily apparent that most technology needs multiple iterations before achieving wide adoption. Web of trust is no exception.

The lack of a widely-adopted precedent implying that some tech is forever poor is a sloppy conclusion to make.

Re:Crev: dependency vetting with a web of trust by stcredzero on Saturday January 05, 2019 @04:01PM (#18834225)
The lack of a widely-adopted precedent implying that some tech is forever poor is a sloppy conclusion to make.

Yes, but decentralized webs of trust have been tried before, and the "flat" ones with no centralization fade away or become hipster tchotkes. I think it's a valuable question to ask. Have we done the analyses for why the previous ones didn't work?

Re:Crev: dependency vetting with a web of trust by kuhhk on Friday January 04, 2019 @11:30AM (#18825228)
> crev is scalable, distributed and social. Users publish and circulate results of their reviews: potentially warning about problems, malicious code, or just encuraging high quality by peer review.

I like this. It would be nice to flag questionable areas outside of the maintainer's control, for other experts to look at. Sometime's I've seen something fishy that I share with a friend/colleague who might know how to interpret it, but often times it's in a language/framework that I might not have a friend to ask.

The open source saying "given enough eyeballs, all bugs are shallow" has always been a faux pas, because there has never been enough eyeballs, especially on small projects. However, something like this could begin to close the gap. +1 from me

Re:Crev: dependency vetting with a web of trust by infogulch on Friday January 04, 2019 @03:55PM (#18827521)
"given enough eyeballs, all bugs are shallow" is a reasonable theory but it includes some dubious assumptions like the distribution of eyeballs over code being or uniform (or proportional to use), frictionless planes, and spherical cows. We may be stuck with spherical cows, but hopefully something like this can help smooth over the eyeball distribution assumption.
Re:Crev: dependency vetting with a web of trust by sgeisler on Friday January 04, 2019 @03:08PM (#18827214)
Imo this is the missing puzzle piece (and the more important one for me personally) for software supply chain security, the other ones being deterministic builds and signed binaries.

And the real problem aren't even people trying to steal your bitcoins [1], you notice that and hopefully had not all your eggs in one basket, it's a (sometimes expensive) lesson in IT security. The much more serious threat are state level actors trying to backdoor secure communication channels, the breach will happen without your knowledge. One shouldn't expect that every nation will take the obvious and public route like the Australian government [2], simply demanding access. With enough resources it seems totally viable to backdoor just one deep dependency of some UI framework and circumvent all end to end encryption used by affected apps.

I hope distributed code review will get some traction not only in the Rust world, but in the whole open source universe.

[1] https://news.ycombinator.com/item?id=18534392

[2] https://arstechnica.com/tech-policy/2018/12/signal-to-austra...

Re:Crev: dependency vetting with a web of trust by mindB on Friday January 04, 2019 @12:00PM (#18825556)
There's some more background and vision for this software in this blog post talking specifically about the Rust ecosystem: https://dpc.pw/cargo-crev-and-rust-2019-fearless-code-reuse

It also has some nicer narrative examples.

Re:Crev: dependency vetting with a web of trust by edraferi on Friday January 04, 2019 @05:02PM (#18828101)
Pretty cool. Long way to go, but great idea.

I like this:

> Design is open for supporting PGP, Salty, Keybase, and whatever else in the future.

> Note: Systems like that don't carry enough information. Just because you verified that someones PGP really belong to them, doesn't mean you trust their code review judgment. But the identity/singing system could be reused.

Re:Crev: dependency vetting with a web of trust by tln on Friday January 04, 2019 @01:37PM (#18826474)
This is a great effort. I hope this takes off and some organizations become vetting entities. It's a lot easier to trust eg Lyft Engineering vetting than Joe Xyz at a glance.
Re:Crev: dependency vetting with a web of trust by weinzierl on Friday January 04, 2019 @01:19PM (#18826286)
> Trust is fundamentally about people and community

This is so important. We souldn't trust packages but the people that assume responsibility for them.

Re:Crev: dependency vetting with a web of trust by fearai on Friday January 04, 2019 @04:37PM (#18827882)
This doesnt prevent trusted people from doing stupid things like this https://news.ycombinator.com/item?id=18534392

We need to trust the code not the programmer

Re:Crev: dependency vetting with a web of trust by habitue on Friday January 04, 2019 @04:50PM (#18827996)
It doesn't prevent anyone from doing anything. It increases the likelihood that if someone does something like that, that it will be detected.

Crev seems interesting because it not only has the web-of-trust mechanic going on, but also because it creates an incentive to actually do code reviews on existing code. There's now a whole open frontier of "code that hasn't been reviewed in crev", which people might feel compelled to jump on. "Hey, my favorite crate isn't reviewed, I'll can do it". etc.

Re:Crev: dependency vetting with a web of trust by dbaupp on Friday January 04, 2019 @04:53PM (#18828022)
I think crev is actually explicitly trying to establish trust for the code, not the programmer.

> It protects against compromised dev accounts, intentional malicious code, typesquating, compromised package registries, or just plain poor quality.

Re:Crev: dependency vetting with a web of trust by sgeisler on Friday January 04, 2019 @05:23PM (#18828274)
It doesn't, but now both the original author and some number of independent reviewers have to do stupid things in order to cause harm. That's an improvement to the current situation where you mainly trust the author in most cases.

A review is only valid for a specific version/hash of a set of files, so if you only upgrade your dependencies once they have enough trusted reviews you should be safe.

Re:Crev: dependency vetting with a web of trust by 3pt14159 on Friday January 04, 2019 @11:53AM (#18825474)
YES! Please let this or something like this take off!

I've been saying for years that webs-of-trust are the solution for so many problems, including this one.

Re:Crev: dependency vetting with a web of trust by macrael on Friday January 04, 2019 @03:04PM (#18827172)
YANWOT. Webs of trust are so obviously good, and yet so obviously have never really been implemented usefully.
Re:Crev: dependency vetting with a web of trust by z3t4 on Friday January 04, 2019 @02:30PM (#18826954)
How does Crev's web of trust work !? What if the malicious user creates a bunch of fake id's to sign the compromised code ?
Re:Crev: dependency vetting with a web of trust by mikekchar on Friday January 04, 2019 @06:28PM (#18828751)
I have a similar thought. WoT relies upon authentication. How does Crev do authentication? What methods are used for key revocation, etc? It didn't seem to me that they were tackling that directly but relying on a proper use of underlying technology. Possibly I'm wrong or possibly they haven't got that far, but I'd love to see a more explicit description of exactly what they've thought out so far.
Re:Crev: dependency vetting with a web of trust by riffraff on Friday January 04, 2019 @03:07PM (#18827204)
Who would trust those?
Re:Crev: dependency vetting with a web of trust by z3t4 on Friday January 04, 2019 @04:26PM (#18827790)
Then the question becomes, how do you know who to trust ? Are you supposed to also vet the id-hashes of the signers ?
Re:Crev: dependency vetting with a web of trust by sgeisler on Friday January 04, 2019 @05:30PM (#18828339)
I guess you will trust coworkers, people you know irl, well known developers, companies you pay for review subscriptions. You don't have to trust all of them 100%if you require multiple reviews per dependency.
Re:Crev: dependency vetting with a web of trust by delinka on Friday January 04, 2019 @02:57PM (#18827135)
How do these reviews and signatures get published? I'd love the ability to search by this extra metadata.
Re:Crev: dependency vetting with a web of trust by mindB on Friday January 04, 2019 @03:25PM (#18827311)
They get published per reviewer as a git repository on e.g. github, which is fine since you're not really supposed to be putting any value whatsoever on joe-random's reviews.
Re:Crev: dependency vetting with a web of trust by matthewbauer on Friday January 04, 2019 @07:04PM (#18828953)
If something’s malicious, shouldn’t we just flag and remove it? Why is a concept of trust needed here?
Re:Crev: dependency vetting with a web of trust by TheCoelacanth on Friday January 04, 2019 @09:17PM (#18829469)
You would, but that doesn't help you until someone figures out that it is malicious. This lets you track who has actually verified that the package is not malicious.
Re:Crev: dependency vetting with a web of trust by outside1234 on Friday January 04, 2019 @07:16PM (#18829002)
Well, because that itself would become another attack vector. You need some sort of post-review after something is flagged malicious to prevent arbitrary take downs.
Re:Crev: dependency vetting with a web of trust by alexchamberlain on Friday January 04, 2019 @01:07PM (#18826191)
It would be really cool if this could express claims about copyright and license, as well as code quality.
Re:Crev: dependency vetting with a web of trust by wyldfire on Friday January 04, 2019 @01:39PM (#18826495)
I don't think you want/need web-of-trust to evaluate licensing. You probably just want to see "what is the full set of (transitive) licenses I'm agreeing to when taking on this new dependency?" Right? If so, there's cargo-license [1] for that.

[1] https://github.com/onur/cargo-license

Re:Crev: dependency vetting with a web of trust by matthewbauer on Friday January 04, 2019 @07:11PM (#18828978)
This seems like something you need a lawyer for. Perhaps a web of lawyers. The hardest part with (L)GPL compliance has a lot to do with the significance of the linked GPL’d code and how enforceable these licenses are. Not easy questions to answer for nonexpeerts and even experts will disagree.
Re:Crev: dependency vetting with a web of trust by mindB on Friday January 04, 2019 @01:24PM (#18826351)
Could you elaborate on what you mean by this? Were you wanting people to be able to publish proofs that they've reviewed the legal standing of the code as well as the code itself for problems?
Re:Crev: dependency vetting with a web of trust by fiddlerwoaroof on Friday January 04, 2019 @01:32PM (#18826446)
It would be useful to know if the MIT library you’re depending on pulls in a AGPL transitive dependency.
Re:Crev: dependency vetting with a web of trust by mindB on Friday January 04, 2019 @04:09PM (#18827646)
I don't see how a cryptographic WoT system is necessary for that kind of concern. That sounds like more tooling needed around the language's basic packaging system.
Re:Crev: dependency vetting with a web of trust by alexchamberlain on Friday January 04, 2019 @01:37PM (#18826473)
Yeah. For example, the original author could declare they own the copyright on xyz release and its released under a certain licence
Re:Crev: dependency vetting with a web of trust by wyldfire on Friday January 04, 2019 @01:41PM (#18826504)
That's stipulated by the crate metadata and the only authority of that claim is the author's, right? Why would you want/need bolstering of that claim by a web-of-trust? What would it mean if the WoT identified a different copyright owner than the author or a different license from the one the author offers?
Re:Crev: dependency vetting with a web of trust by awinter-py on Friday January 04, 2019 @11:49AM (#18825434)
trust networks for software supply chain, love it