Hacker News new | ask | show | jobs
by nirinor 22 days ago
Woohoo, that's a release! My personal favorites:

- Stabilize never type

- Stabilize custom allocators

- Introduced minimum publish age configurations, also known as dependency cooldowns. When the relevant config is set, the resolver ignores versions published more recently than that, unless they are already in Cargo.lock. (RFC 3923) docs #17335

- cargo-install: now uses the existing lockfile in the .crate tarball by default. --locked in cargo install becomes a no-op. #17388

2 comments

> cargo-install: now uses the existing lockfile in the .crate tarball by default. --locked in cargo install becomes a no-op. #17388

Long time follower of this. Very grateful it's been implemented.

For anyone that wants more context on the decision, see https://github.com/rust-lang/cargo/issues/7169#issuecomment-...
That was one of the biggest gotchas with Rust. It’s unfortunate that it took so long to change this very unintuitive and potentially dangerous behavior.
Dependency cooldowns receiving such a whiplash this year. Earlier everyone was advocating for them because of the supply chain attacks. Now, people are worried because you might miss 0 days if you use them.

Nonetheless, the ability to set and configure it is a welcome feature.

You should do both: you should let normal updates cool down, and you should immediately patch security advisories.

One of the biggest ergonomic problems with cooldowns is that many tools let the former goal obstruct the latter. Both should be part of the state machine of resolution itself, rather than things that get layered on.

Usually people advocate dependency cooldowns as a mitigation for supply-chain attacks, where you're depending on a module with a malicious maintainer, possibly a new one (perhaps one who stole the old maintainer's keys so they can pretend to be the old maintainer).

In that situation, how do you distinguish between "normal updates" (that you should let cool down) and "security advisories"? If all the hypothetical malicious maintainer has to do to get you to update is to publish a security advisory for their own package, wouldn't they just do that? It might even be a real advisory about a real security hole that they introduced, but claiming more versions are affected than actually are affected.

It takes additional permissions, in general, to issue an advisory. And “supply chain” attacks in general tend to be used by smash-and-grab attackers, who don’t have time on their side. It’s not like a browser 0day where the attacker’s goal is to preserve their underlying exploit primitive for as long as possible.
Additional permissions?
I’m talking about things like GHSAs. You can’t issue one just by compromising a push credential to a repository, which is how most of these supply chain attacks start.
Waiting for someone to hold back a vulnerability until they can compromise a package, then release vuln publicly for maximum impact.

It’s only a matter of time.

How do you separate security advisories from regular updates? (If it’s just a box you check, it only means attackers will say “this is a security update” on the malicious package they upload.)

The point of cooldowns is for when a crate author’s account is compromised and used to publish malicious code. Saying “security advisories bypass cooldowns” wouldn’t really help anything there.

> If it’s just a box you check, it only means attackers will say “this is a security update” on the malicious package they upload.

It generally requires additional permissions, per the adjacent respond. And it introduces additional scrutiny on the release, which is the last thing an opportunistic attacker wants (the entire reason “supply chain” attacks are effective is because nobody gives any thought to upgrading their dependencies in the normal case).

There are many cases in which security advisories aren't published. But I guess an alternative could be to update using the cooldown, and then diff the dependencies that would get a newer version if the cooldown wasn't in place to check if they contain anything relevant for the particular application you're developing.
Why wouldn't a supply-chain attacker simply manipulate the project into producing a security advisory to get their exploit code pushed through inside a high-priority release?

I.e. get a puppet/co-conspirator to push vulnerable code; wait until that code gets released as v1.2.3; submit other vulnerable code; wait for that code to be merged and released as v1.2.4; then submit a vuln report for the vuln introduced in v1.2.3; and wait for v1.2.3 + v1.2.4 to be security-deprecated and v1.2.5 to be fast-released to replace them.

Now v1.2.5 exists and has your still-unknown 0day in it, while versions prior to v1.2.5 are deprecated. If devtools that had pinned v1.2.3 get forced "upward" to v1.2.5 despite the cooldown, you win.

I haven't seen anyone advocate against cooldowns because those are completely different problems.

How would removing cooldowns help you patch vulnerabilities? That would imply that your CI is configured to update dependencies, rebuild, and push them to production without human oversight?

That's obviously not the way to go, you must have human oversight and if you do then your humans should be alerted when one of your dependencies patches a security issue. At that point you review it, override the cooldown, and push it to production.

You should use a cooldown. The effects of a supply chain attack are significantly worse than the effects of a 0 day. You can always make exceptions on a case-by-case basis.
Some of us were saying they didn't understand the endgame of everyone using cooldowns at the time. We mostly got told we were wrong though.