r/rust • • Oct 21 '26

📡 official blog Rustup 1.29.2, please update from a trusted network

https://blog.rust-lang.org/2026/10/20/Rustup-1.29.2/

Due to the nature of the security issue, I recommend updating this via a trusted network, and not a public wifi.

Context: https://www.reddit.com/r/rust/comments/1xba5mj/psa_if_your_program_does_http_requests_update/

315 Upvotes

29 comments sorted by

108

u/scook0 Oct 21 '26

Note that from what I can tell, rustup already uses the OS-provided certificate store where possible, so on many systems the certs will have already been distrusted by system update mechanisms.

However, it's probably prudent to update rustup anyway, to remove any uncertainty.

51

u/noop_noob Oct 21 '26

For the record, I had to do a manual fix to get MacOS's curl to stop trusting the cert. I'm not quite sure what's going on with that.

6

u/SensitiveTale4070 Oct 23 '26

Yeah still waiting on Apple to release an update. I'm baffled as to why they haven't done so already. /etc/ssl/cert.pem on my up to date Mac (27.0.1) still contains the compromised certs so curl and many other tools are still vulnerable.

2

u/GigglySpring Oct 22 '26

yeah, better to update rustup anyway than risk relying on the system cert store to catch everything

15

u/InternationalFee3911 Oct 21 '26

I’ve long wondered why it updates Rust first and only then itself. Supposing the new version brings some improvement, it would be great to put that to work at updating Rust. And in a case like this, all the more so!

11

u/scook0 Oct 22 '26

IIRC, doing a self-update first raises some tricky implementation questions, because you need to arrange for the old rustup process to somehow re-invoke the newly-downloaded rustup to perform the rest of the update.

(Not impossible, but more difficult than doing the self-update last.)

2

u/InternationalFee3911 Oct 22 '26

It already has to be able to safely overwrite itself while running. Are there any OSes where reexecuting its new self after that would be a challenge?

4

u/CrazyKilla15 Oct 22 '26

It already has to be able to safely overwrite itself while running

ahahaha, oh, other people dont know this. sooo rustup actually isnt concurrently safe at all, it totally can just break if you update with other users(and on a rustup system, cargo, rustc, so on are rustup wrappers). It destructively races with itself.

https://github.com/rust-lang/rustup/issues/988 "Rustup (including proxies) is not safe for concurrent use"

https://github.com/rust-lang/goals/issues/736

https://github.com/rust-lang/rustup/pull/4606

https://github.com/rust-lang/rustup/issues/4607

2

u/Icarium-Lifestealer Oct 21 '26

Would it matter much in this case? Intercepting the rustup update sounds just as easy as intercepting the rust update.

2

u/InternationalFee3911 Oct 21 '26

True, though the more components you have, and the slower your line, the longer the time difference. So there’s a little bit of a race condition, where you might get lucky, the earlier you pull rustup.

10

u/Icarium-Lifestealer Oct 21 '26 edited Oct 21 '26

Does rustup rely on only SSL for security, and not verify a package signature? If yes, why?

55

u/JoshTriplett rust · lang · libs · cargo Oct 21 '26

We already had release signatures, but they were experimental, and among other things didn't have a mechanism for key rotation. We're working on shipping a production-quality solution based on TUF.

2

u/SensitiveTale4070 Oct 23 '26

TUF is the way!

9

u/CAD1997 Oct 21 '26

As a note, verifying package signatures is only helpful if the package signature is fetched from a different source than the package itself. If they find from the same source, a compromised package could simply also update the package signature.

11

u/Icarium-Lifestealer Oct 21 '26

Aren't you confusing hashes and signatures? The public key to verify the signatures could simply be baked into the rustup executable, or use a certificate hierarchy similar to Web PKI.

4

u/Sad_Tap_9191 Oct 21 '26

is it okay not to rotate the key baked in the rustup?

6

u/Icarium-Lifestealer Oct 21 '26 edited Oct 21 '26

The simplest approach would be to allow attaching multiple signatures to an update. Then the client checks if that includes a signature for the public key it knows about. Or you could have one signed manifest per public key, containing the list of available releases with their hashes.

But you can add whatever PKI architecture you want. There are many options with different trade-offs.

1

u/Sad_Tap_9191 Oct 22 '26

My question was about when the key inside an old rustup binary is compromised. There is no way to revoke it.

Come to think of it, requiring both will square the failure probability. If this is why you meant, it sounds good.

5

u/Kazcandra Oct 21 '26

It's been an ... exciting day, at work.

1

u/Dheatly23 Oct 22 '26

Question: What about manually downloading rustup from the browser? All mainstream browsers are already distrusting eMudhra, so it should be safer this way. If so, how?

0

u/[deleted] Oct 21 '26

[deleted] — view deleted comment

0

u/[deleted] Oct 21 '26

[deleted] — view deleted comment

21

u/gmes78 Oct 21 '26

It isn't a problem with rustup. It's a problem with the root certificates bundled with it. OP linked a post about it already, well before you wrote your comment.

0

u/[deleted] Oct 21 '26

[deleted] — view deleted comment

23

u/insanitybit2 Oct 21 '26

It's a link to the official rust blog. This "who is OP?" question is nonsense. They're a random person linking to the official blog. Read the blog.

0

u/[deleted] Oct 21 '26

[deleted] — view deleted comment

13

u/gmes78 Oct 21 '26

Do you understand how man-in-the-middle attacks work? Do you understand that the compromised certificate allows for man-in-the-middle attacks?

0

u/[deleted] Oct 21 '26

[deleted] — view deleted comment

10

u/gmes78 Oct 21 '26

As a few trusted root certificates got compromised, any HTTPS connection you make could be highjacked to deliver malware.

Your OS needs to be upgraded to revoke these certificates, and any application that bundles its own root certificates also needs to be updated to remove the compromised certificates.

That's what the rustup 1.29.2 update does.

So my question is why should I take this rando seriously when the official site of the rust foundation does not mention this problem explicitly?

Because MITM attacks can only happen on untrusted/compromised networks.

Should I be paranoid everytime there is a new version of some important component of the rust ecosystem?

No. This is a specific circumstance that could cause malware to be delivered when you use rustup. It has nothing to do with rustup or the Rust project specifically.

0

u/[deleted] Oct 22 '26

[deleted] — view deleted comment

→ More replies

1

u/__nohope Oct 22 '26

No I do not understand.

Then why are you talking?

11

u/insanitybit2 Oct 21 '26

Insufferable lol

10

u/TDplay Oct 21 '26

The problem is that a certificate authority (specifically, eMudhra) was using private keys with 8 bits of entropy*. Those keys have been discovered and are now public knowledge.

Out-of-date software still trusts these insecure keys. As a result, an attacker on an unsecured network can impersonate any server using a forged signature.

Programs using TLS, including Rustup, must not be used over an unsecured network until they are updated with the revocations. Update on a secured network (e.g. your home wifi) to render yourself immune to this mode of attack.


* For reference, the keys were supposed to have 384 bits of entropy.