News for hackers. Stuff that matters.
Re:Vetting the Cargo by hda2 on Monday June 13, 2022 @12:04AM (#31720953)
This sounds a lot like cargo-crev but without off-line cryptographic signatures, a significant downgrade in my view.

Edit: Yep: https://mozilla.github.io/cargo-vet/design-choice-faq.html#h...

None of the reasons given by Mozilla seem to justify the downgrade in security, especially since most can be worked around with crev which already employs secure and well-tested authentication schemes.

What also makes this situation peculiar to me is that it's being immediately rushed into Cargo proper instead of the usual way these tools are handled by the Cargo team (i.e. allowing multiple ideas to compete as third-party tools and maybe choosing one once a winner is clear). I understand the recent string of security issues might have played a role here, but I wouldn't expect their reaction to be steamrolling an inferior version of crev as a builtin tool.

I would really like to know what happened here.

Disclosure: I use neither tool, but I'm very interested in the security and health of the Rust ecosystem.

Re:Vetting the Cargo by LegionMammal978 on Monday June 13, 2022 @12:47AM (#31721270)
> What also makes this situation peculiar to me is that it's being immediately rushed into Cargo proper instead of the usual way these tools are handled by the Cargo team (i.e. allowing multiple ideas to compete as third-party tools and maybe choosing one once a winner is clear).

This tool isn't being pushed into Cargo proper, and I doubt it will be any time soon. Instead, it is a third-party crate called "cargo-vet". If an executable named "cargo-whatever" is in the search path, Cargo can invoke it as a subcommand "cargo whatever". See Cargo's docs for more info: https://doc.rust-lang.org/cargo/reference/external-tools.htm...

Re:Vetting the Cargo by cozzyd on Monday June 13, 2022 @01:24AM (#31721514)
hopefully nobody adds a cargo-buidl package then!
Re:Vetting the Cargo by royjacobs on Monday June 13, 2022 @03:06AM (#31722199)
You need to explicitly install these tools, so you can't "accidentally" invoke cargo-buidl from a transitive dependency or anything.

It's not like a tool like npx which will allow you to invoke code in arbitrary packages.

Re:Vetting the Cargo by cozzyd on Monday June 13, 2022 @04:31AM (#31722749)
yeah it's great that "cargo buidl" doesn't automatically try to download and install cargo-buidl but if cargo-buidl somehow ends up in your $PATH (perhaps installed as a side effect of another package or even some other package manager like pip) then it will run. Though I guess someone could also just as easily put a malicious cargo in your $PATH and that will work in most cases, depending on precedence...
Re:Vetting the Cargo by nindalf on Monday June 13, 2022 @03:04AM (#31722190)
Why would a user install a cargo-buidl package when cargo build already works?

Typosquatting is definitely an issue, but not in this specific case.

Re:Vetting the Cargo by kzrdude on Monday June 13, 2022 @03:44AM (#31722444)
The binary can be named that without the package being named so, so it seems it could happen
Re:Vetting the Cargo by dmytrish on Monday June 13, 2022 @07:33AM (#31723984)
If an intruder can rename files in your $PATH, the defense is already broken (e.g. they could do the same with any of .bashrc, .profile, anything in .local/bin and many, many other places). If a program can run seemingly innocent programs like less or sed, it already can run arbitrary commands.

Security story of developing on Linux is basically non-existent unless you do everything on a remote machine or at least in a container (and, oh irony: direct access from your user to the Docker daemon basically means having root for that user).

Re:Vetting the Cargo by kzrdude on Monday June 13, 2022 @07:57AM (#31724193)
Well I was thinking that "cargo install foo" can already install cargo-buidl in your path by innocent means i.e. no Rust build script.

But with build scripts (build.rs) any crate indeed has arbitrary code execution at build time, so they can't be trusted, like you imply.

However, sandboxing might be coming for build scripts, and when that's done, the typo attack is still there (package "foo" installing cargo-buidl).

Re:Vetting the Cargo by cozzyd on Monday June 13, 2022 @03:51AM (#31722486)
right, but cargo-buidl could be installed as part of a different package that also provides a more useful-sounding binary, no?
Re:Vetting the Cargo by pornel on Monday June 13, 2022 @08:45AM (#31724722)
That's fine. The biggest problem right now is getting people actually review their dependencies. If cargo-vet can make that easier by removing hassle of signatures and WoT, it's still a huge benefit to the community. It's possible to make cargo-vet <> cargo-crev export tools.
Re:Vetting the Cargo by rslabbert on Monday June 13, 2022 @01:44AM (#31721646)
Since the audits are designed to be used at a per project level and contributed directly into the VCS repo (allowing you to using git signing for example) I don't quite understand what additional off-line cryptographic signatures are required here (considering that Cargo's lockfiles already contain a hash of the crate which would prevent the project from getting an altered version of a crate accidentally and that SHA validation is being considered as part of vet as well https://github.com/mozilla/cargo-vet/issues/116).