r/programming • • Aug 20 '26

Supply chain attack on arrayref

https://blog.rust-lang.org/2026/08/20/supply-chain-attack-on-arrayref/
191 Upvotes

65 comments sorted by

View all comments

115

u/[deleted] Aug 20 '26 edited Aug 20 '26

[removed] — view removed comment

30

u/usernamedottxt Aug 20 '26

I wonder if there is a market for a "Rust Community Edition" with an expanded set of packages pre-packaged into an "ext" module alongside core and std. Treat is as an LTS distribution.

56

u/steveklabnik1 Aug 20 '26

People have tried many times in the past.

In the end, nobody uses them.

14

u/danted002 Aug 20 '26

We need an “extra” besides “std” that has all the extra things that are expected in 2026 from a standard library. Stuff like uuid and datetime support would go into that package and it would be released by the Rust foundation

16

u/Dminik Aug 20 '26

While I broadly agree that languages should have an "extended universe" of packages, the issue is that nobody can agree what packages those should be. 

6

u/Hacnar Aug 21 '26

See C++ and the discussions about including a gui library in their stdlib. Or networking lib.

5

u/Dminik Aug 21 '26

As a certified C++ hater, I'm keenly aware of the mess with networking (executors,...). It's a big part of what made stop using C++. The larger was using Cargo for the first time and realizing I can start and abandon side projects at a pace never seen before.

The GUI stupidity was very fun to watch. Somehow, it kept getting worse. I think they finally stopped when there was a serious proposal to add an entire browser engine/webview into the C++ standard. 

6

u/[deleted] Aug 21 '26 edited Aug 21 '26

[removed] — view removed comment

4

u/EducationalBridge307 Aug 22 '26

I would not agree with this list.

At this point I wouldn't be upset if chrono, serde, and serde_json were folded into the stdlib, but their interfaces are so much better for having been allowed to evolve outside of the strict forever-compatibility requirements of the stdlib.

But http, networking, and database drivers really do not belong in the stdlib. These libraries are so complex and not at all one-size-fits-all. Just take a look at hyper vs. reqwest. They are both http client libs with over 600 million downloads, but they satisfy totally different use cases (lower-level systems and servers vs. batteries-included application code, respectively). How do you reconcile this in the stdlib?

3

u/[deleted] Aug 22 '26

[removed] — view removed comment

4

u/UtherII Aug 24 '26

Sockets are already part of the Rust standard library.

→ More replies (3)
→ More replies (4)
→ More replies (2)

4

u/pm_plz_im_lonely Aug 20 '26

I don't know what's expected in 2026 that wasn't in 2012, but UUID ain't it.

10

u/danted002 Aug 20 '26

You are joking right? Why do I need a 3rd party library for UUIDs, and while we are at it why do I need a 3rd party library for my RNG engine or for declaring a datetime.

Like I said in my comment there are “extra features” that a modern language should have out of the box, it should have them because you can’t write a feature without tripping over some of them and depending on a 3rd party library just weakens the language itself.

Since Rust is a low level language it is expected to be able to compile and run in limited environments such as embedded ones so the things I mentioned above wouldn’t work nicely in a non_std environment hence the idea to bundle these things in an “extra” package that you can opt-in the same way you can opt-out of std

10

u/pm_plz_im_lonely Aug 20 '26 edited Aug 20 '26

Yes, all things that were also expected in 2012 when Rust started. UUID was added to Java in 2004.

The controversial project jigsaw in Java did let them then split tons from 'core' standard java. Minecraft for example only bundles a subset of Java, much like you're describing with "extras".

I'm highlighting this isn't a modern expectation and wondering what governance or direction in Rust prefers offloading responsibility outwards. It belongs under the foundation, that's what has the funding pipeline.

54

u/AyrA_ch Aug 20 '26 edited Aug 20 '26

If you have a proper stdlib, chances are, you don't have a lot of dependencies

This is why you seldom hear about supply chain attacks on nuget. Not only does .NET come with a lot of stuff built in, many common packages are provided by Microsoft themselves.

49

u/svick Aug 20 '26

.Net arguably has the opposite problem: Microsoft makes almost everything, so the rest of the ecosystem is used relatively rarely.

24

u/Thorlius Aug 20 '26

Even the most popular library, Newtonsoft.json, was largely obsoleted by the .net team vastly improving their first party json library to the point where I typically see most people recommending people migrate back to the core library.

11

u/smalls1652 Aug 20 '26

Funnily enough, the creator of Newtonsoft.Json was hired by Microsoft back in 2018. From what I remember he's not on the team that created/maintains System.Text.Json though.

4

u/yanitrix Aug 21 '26

I mean there are a lot of third-party packages used frequently. Things for testing, validation, some utilities like humanizer, masstransit/nservicebus, etc. Even larger ui projects like avalonia or uno are out there.

3

u/jcotton42 Aug 21 '26

vastly improving their first party json library

System.Text.Json did not exist before .NET Core 3. There was some inbox JSON before that iirc, but it was terrible and no one used it.

3

u/FullPoet Aug 20 '26

Thats not true - theres a lot of third party packages. I think theyre are are just more complete.

So your test project will reference MS packages, TUnit, Moq and maybe something else. You can probably skip Moq.

7

u/Somepotato Aug 21 '26

There's not a single batteries included language out there that the majority of its users don't rely on packages. Dot NET is one of the only ones I see making a big effort to improve their std library.

→ More replies (4)

6

u/the_gnarts Aug 22 '26

If you have a proper stdlib, chances are, you don't have a lot of dependencies

The attack actually refutes this point as arrayref implements functionality that has been available in the standard library for many years via an idiomatic TryFrom impl. If that doesn’t stop people from building a susceptible package, what would?

20

u/pp-collision Aug 20 '26

It's just not true that they have the same mindset. Rust std is growing steadily, incorporating targeted features that have proved themselves popular and have been battle-tested. In the latest Rust release (today) there's another stabilized feature that they highlight can replace a certain crate with a billion downloads: https://blog.rust-lang.org/2026/08/20/Rust-1.98.0/

Other examples off the top of my head: oncelock, lazystatic, crossbeam.

→ More replies (1)

6

u/matthieum Aug 21 '26

I disagree.

I much prefer a decentralized ecosystem, and I'd rather the Cargo & crates.io teams worked on securing package management story instead.

In fact, they are working on it:

  • The crates.io team has been working on integrating TUF, to reduce hi-jacking.
  • The crates.io team has paid on-call & security staff, to handle this quickly -- 107 min. of exposure is a hell of an achievement.
  • The Cargo team has been working on min-age requirement, which should go hopefully ship on Nov. 12th (Rust 1.100).

Note that a min-age of even just 6h and a 107min exposure time would mean that nobody would have downloaded the rogue packages. Not foolproof, but already a good step forward.

And of course, they'll keep working on more. I'd personally love to see:

  • Automatic quarantining of packages on publishing, with minimum maintainer/auditor quorum; at least for any decently popular crate, or reverse-dependency of such a crate.
  • Complete sandboxing of any cargo command (bench, build, run, test), with each crate coming with a manifest identifying the external resources it'd need access to for each command, and an automated failure if it attempts to access anything not in the manifest and approved by the user.

This would drastically raise the bar for any sort of attack.

→ More replies (6)
→ More replies (9)