# Protection/mitigation of SCA's with cargo

**URL:** <https://users.rust-lang.org/t/protection-mitigation-of-scas-with-cargo/140111>\
**Category:** uncategorized\
**Created:** [May 15, 2026, 3:09pm UTC](https://users.rust-lang.org/t/protection-mitigation-of-scas-with-cargo/140111 "2026-05-15T15:09:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marlez](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/marlez/32/52182_2.png) [@marlez](https://users.rust-lang.org/u/marlez)\
**Post date:** [May 15, 2026, 3:09pm UTC](https://users.rust-lang.org/t/protection-mitigation-of-scas-with-cargo/140111/1 "2026-05-15T15:09:25Z")

</div>

As [SCA](https://snyk.io/blog/tanstack-npm-packages-compromised/)'s keep on surfacing left and right, with quite a few attributable to a perfectly sane practice of `preinstall` hooks enabled by default in `npm` et al; is `cargo` in any way more secure, by design and/or surface area it covers?

I do not remember seeing any "hooks" anywhere near the Rust's package management toolkit, at least not in the traditional sense of the word; yet any crate that wishes to "preinstall" anything with a `build.rs` instead, can still do so - can it not?

---

<div class="post-metadata">

**Author:** ![kpreid](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/kpreid/32/22420_2.png) [@kpreid](https://users.rust-lang.org/u/kpreid)\
**Post date:** [May 15, 2026, 3:45pm UTC](https://users.rust-lang.org/t/protection-mitigation-of-scas-with-cargo/140111/2 "2026-05-15T15:45:39Z")

</div>

There are various proposals in progress, such as [adding sandboxing](https://github.com/rust-lang/compiler-team/issues/475) (but this needs further design work and somewhat conflicts with what a `build.rs` _should_ be able to do) and adding [a min-publish-age feature](https://github.com/rust-lang/rfcs/pull/3923) (but this depends on somebody spotting the attack).

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/system/32/51372_2.png) [@system](https://users.rust-lang.org/u/system)\
**Post date:** [August 13, 2026, 3:46pm UTC](https://users.rust-lang.org/t/protection-mitigation-of-scas-with-cargo/140111/3 "2026-08-13T15:46:11Z")

</div>

Closed on August 13, 2026, 3:46pm UTC

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.
