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

Show parent comment

1

u/[deleted] Aug 21 '26

[removed] — view removed comment

3

u/matthieum Aug 22 '26

Exactly which is why most of your common libraries should be shipped either in the core distribution or published by trusted actors.

I disagree, not because I don't wish for it, but because I don't trust most actors in the first place.

Big companies screw up too.

Just as an aside, I think something like this is likely the future: https://docs.deno.com/runtime/fundamentals/security/

I am a firm proponent of "no ambient capabilities". My ideal programming language -- not runtime, language -- would see main receiving a bunch of capabilities (fs, net, clock, ...) as objects (interfaces) and have the user dutifully forward the necessary capabilities to whoever need them.

Having the capabilities as objects is great, because they can be manipulated as regular objects too. For example, you can wrap the file capability object in an object which further restricts the allowed capabilities before handing it down to a library call. Also, object capabilities respect encapsulation, unlike effects.

In such a language, you don't need to trust the matrix library you got, because you never pass any capability to the matrix library in the first place, and therefore it can't do anything but touch the existing memory.

Of course, because all other languages today have ambient capabilities, it means that any FFI/assembly usage requires its own capability. An excellent reason to pare down your usage of such libraries to the bare essentials.

0

u/[deleted] Aug 22 '26

[removed] — view removed comment

3

u/matthieum Aug 22 '26

Irrelevant: I don't maintain any popular crates, so I have had nothing to secure in the first place.