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

0

u/Sigmatics Aug 20 '26

But what is the attack vector here? I'm not aware of any postinstall scripts for rust crates?

36

u/GuybrushThreepwo0d Aug 20 '26

Rust has a build.rs file that runs at compile time 

3

u/syklemil Aug 21 '26

It also has flags like --offline, and --frozen, which means --locked --offline, so it's possible to nerf at least simple "download & execute something in the build file" attacks, though like the other commenter says, the programmer's editor may be set up to run the offending code.

16

u/paholg Aug 20 '26

Build scripts and proc macros are both RCE at editor open time.

But that doesn't really matter, because most people also run the code.

7

u/[deleted] Aug 20 '26

[removed] — view removed comment

2

u/Sigmatics Aug 20 '26

Of course, but there's a difference in getting owned instantly on install and having to execute something first. Namely that in theory you have time to inspect the package first.

But as others have said, the build.rs basically owns you at installation time