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...
It's not like a tool like npx which will allow you to invoke code in arbitrary packages.
Typosquatting is definitely an issue, but not in this specific case.
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).
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).
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.