Vetting the Cargo
lwn.net
lwn.net
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.
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...
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).
It's not like a tool like npx which will allow you to invoke code in arbitrary packages.
This is really exciting and I hope it gets adopted by all package ecosystems.
Of course audits can't guarantee to find the most underhanded "bugdoors", but it will still be a huge step forwards if third parties can vouch for various properties of the code you are about to install, such as it being reproducibly built from a tagged release on a public repository, with no Unicode homoglyphs or unexplained high-entropy strings in the code, and the unit tests all passing.
This will naturally lead to the question of who can be trusted to provide these audits, but such automatable checks could be done by almost anyone and their reputation could grow with time (which might lead to second-layer systems which track which auditors make the most accurate claims). Perhaps there will be companies that offer cyber-insurance against these specific threats, and use the premiums from that to fund the audit checks.
- https://github.com/crev-dev/crev
- https://github.com/vouch-dev/vouch
Anyone know of any more alternatives or similar tools already available?
Could this lead to the auditor getting sued?
I wouldn't mind getting a legal take on cargo-vet and similar tools.
I found one in Mozilla's GitHub[1], but it only has five entries. Moreover all of the crates in the file were audited by their respective authors - which kind of goes against the whole idea of this thing.
Overall GitHub seems to only have six audits.toml files[1], two of which are the Mozilla one mentioned above, the other four are empty.
[1] https://github.com/mozilla/gecko-dev/blob/64f3b7d019700f4fe3...
[2] https://github.com/search?q=filename%3Aaudits.toml&type=code
In real life however we have to accept imperfections, in which good-enough is often better than not at all
tl'dr
* internal management of audits.
* reading audits in from trusted third parties.
I'm glad that someone is starting to tackle this terrifying problem.
[1] https://mozilla.github.io/cargo-vet/importing-audits.html
The irony is palpable.
Shouldn't exists because why? Because people should just be nice?
Supply-chain attacks are a real vector, one that seems to be able to have a larger impact by each day, as the OSS ecosystem grows and the dependency of using dependencies grow.
People want to be able to use 3rd party packages, like we've been doing for quite some time now. But there are a lot of them, and no (easy) way to manage exactly which one are "good" vs not, without manually going through each one of them, for each project.
We either need solutions to improve the supply chain safety or never use third party dependencies.
Wow. This makes me feel like I have to stop using Firefox.
I wonder if others feel the same, or have a different analysis. For example, is the situation with Chrome better?
In fact, Firefox itself did not do this until recent years.
It is true that modern JS development often works that way (as does Rust and some others), but it is not the norm in all ecosystems, and definitely wasn't in browsers.
Of course there may have been exceptions I am not aware of, and developers are humans that can make mistakes, but that is the overall culture I experienced. It is fundamentally different to the JS/Rust/etc. ecosystem models.
I already had that urge in a powerful way after the last ESR update filled my browser with seemingly impossible to remove Bing and Google search hooks, among other obnoxious commercial b.s. I specifically use Firefox to not have shoved in my face at the browser internals level.
I'd probably be using Epiphany/GNOME Web full-time if it provided a noscript analog.
Though Google's deep pockets for security work do likely convey advantage.
(Of course good control of versions is still a worthy goal for many situations even if you don't do this)
You have to rely on something in life, just like in an office building you can't realistically check the structure inside-out, or if you can, how can you make sure that the individual components are actually of the material they say they are? Have you double-checked your local water table yourself? Have you done geological studies to uncover vulnerabilities the subcontracting firm building the office may not have done correctly? What is the effect of local radio-interference or power quality on your equipment? Are your UPS-devices actually performing to spec?
Sure, but it may also be a comparison between grandma's apple pie and the apple pie from the supermarket. If you never looked at the ingredient list of the latter, you're bound to be surprised at what you're getting. If grandma hand picked her apples from the back yard, you may be unhappy to learn about the pesticides used for commercially grown apples.
> You have to rely on something in life, just like in an office building you can't realistically check the structure inside-out, or if you can, how can you make sure that the individual components are actually of the material they say they are?
In that case, there are building codes as well as checks to ensure they are followed. While it is possible for someone to ignore those codes, there is also a cost for doing so if you are caught. For the most part, the software industry doesn't have building codes. If something fails, software licenses are generally written to avoid accountability. About the only constraint is the negative response of the market, but even that can be managed to some degree.