frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Supply chain nightmare: How Rust will be attacked and what we can do to mitigate

https://kerkour.com/rust-supply-chain-nightmare
39•fanf2•1h ago

Comments

lesuorac•1h ago
Eh, the only way to secure your Rust programs it the technique not described in the article.

Vendor your dependencies. Download the source and serve it via your own repository (ex. [1]). For dependencies that you feel should be part of the "Standard Library" (i.e. crates developed by the Rust team but not included into std) don't bother to audit them. For the other sources, read the code and decide if it's safe.

I'm honestly starting to regret not starting a company like 7 years ago where all I do is read OSS code and host libraries I've audited (for a fee to the end-user of course). This was more relevant for USG type work where using code sourced from an American is materially different than code sourced from non-American.

[1]: https://docs.gitea.com/usage/packages/cargo

whytevuhuni•1h ago
The only thing this leads to is that you'll have hundreds of vendored dependencies, with a combined size impossible to audit yourself.

But if you somehow do manage that, then you'll soon have hundreds of outdated vendored dependencies, full of unpatched security issues.

QuantumNomad_•41m ago
> full of unpatched security issues

If you host your own internal crates.io mirror, I see two ways to stay on top of security issues that have been fixed upstream. Both involving the use of

  cargo audit
which uses the RustSec advisory DB https://rustsec.org/

Alternative A) would be to redirect the DNS for crates.io in your company internal DNS server to point at your own mirror, and to have your company servers and laptops/workstations all use your company internal DNS server only. And have the servers and laptops/workstations trust a company controlled CA certificate that issues TLS certificates for “crates.io”. Then cargo and cargo audit would work transparently assuming they use the host CA trust store when validating the TLS certificates when they connect to crates.io. The RustSec DB you use directly from upstream, not even mirroring it and hosting an internal copy. Drawback is if you accidentally leave some servers or laptops/workstations using external DNS, and connections are made to the real crates.io instead. Because then developers end up pulling in versions of deps that have not been audited by the company itself and added to the internal mirror.

Alternative B) that I see is to set up the crates host to use a DNS name under your own control. E.g. crates dot your company internal network DNS name. And then set up cargo audit to use an internally hosted copy of the advisory DB that is always automatically kept up to date but has replaced the cargo registry they are referring to to be your own cargo crates mirror registry. I think that should work. It is already very easy to set up your own crates mirror registry, cargo has excellent support built right into it for using crates registries other than or in addition to crates.io. And then you have a company policy that crates.io is never to be used and you enforce it with automatic scanning of all company repos that checks that no entries in Cargo.toml and Cargo.lock files use crates.io.

It would probably be a good idea even to have separate internal crate registries for crates that are from crates.io and crates that are internal to the company itself. To avoid any name collisions and the likes.

Regardless if going with A) or B), you’d then be able to run cargo audit and see security advisories for all your dependencies, while the dependencies themselves are downloaded from your internal mirror of crates.io crates, and where you audit every package source code before adding it in your internal mirror registry.

echelon•17m ago
A large number of security issues in the supply chain are found in the weeks or months after library version bumps. Simply waiting six months to update dependency versions can skip these. It allows time to pass and for the dependency changes to receive more eyeballs.

Vendoring buys and additional layer of security.

When everyone has Claude Mythos, we can self-audit our supply chain in an automated fashion.

woodruffw•1h ago
> Let me rephrase this, 17% of the most popular Rust packages contain code that virtually nobody knows what it does (I can't imagine about the long tail which receives less attention).

I think this post has some good information in it, but this is essentially overstated: I look at crate discrepancies pretty often as part of reviewing dependency updates, and >90% of the time it's a single line difference (like a timestamp, hash, or some other shudder between the state of the tree at tag-time and the state at release-time). These are non-ideal from a consistency perspective, but they aren't cause for this degree of alarm -- we do know what the code does, because the discrepancies are often trivial.

ethanj8011•1h ago
Isn't the point that unless actually audited each time, the code could still be effectively anything?
woodruffw•54m ago
Yes, but that's already the case. My point was that in practice the current discrepancies observed don't represent a complete disconnect between the ground truth (the source repo) and the package index, they tend to be minor. So describing the situation as "nobody knows what 17% of the top crates.io packages do" is an overstatement.
dralley•52m ago
I think it just depends on whether or not you interpret the phrase "no one knows" neutrally or pessimistically.

Saying that there could be something there, but "no one knows" doesn't mean that there is something there. But it's still true.

woodruffw•48m ago
If that's the case, it would be a lot simpler (and equally accurate) to say that "no one knows" what the source repo is doing, either! The median consumer of packages in any packaging ecosystem is absolutely not reading the entire source code of their dependencies, in either the ground truth or index form.
dralley•45m ago
That's certainly true - and would also be true (maybe even moreso) if vendoring dependencies was widespread. Seems just as easy to hide things in a "vendored" directory that's 20x the size of the library.
echelon•15m ago
Serious consideration: Claude Mythos is going to change the risk envelope of this problem.

We're still thinking in the old mindset, whereas new tools are going to change how all of this is done.

In some years dependencies will undergo various types of automated vetting - bugs (various categories), memory, performance, correctness, etc. We need to think about how to scale this problem instead. We're not ready for it.

EGreg•43m ago
Why not pin your packages? Andnwhy not have M of N auditors sign off on releases?
bcjdjsndon•34m ago
But it's impossible to have a buffet overflow in rust
CoastalCoder•27m ago
> But it's impossible to have a buffet overflow in rust

I dunno, I can only listen to Margaritaville so many times in a row.

amelius•28m ago
Rust should add a way to sandbox every dependency.

It's basically what we're already doing in our OSes (mobile at least), but now it should happen on the level of submodules.

tasuki•21m ago
> In a recent analysis, Adam Harvey found that among the 999 most popular crates on crates.io, around 17% contained code that do not match their code repository.

Huh, how is this possible? Is the code not pulled from the repository? Why not?

sudoapps•11m ago
Coding agents should help us reduce dependencies overall. I agree Go is already best positioned as a language for this. Using random dependencies for some small feature seems archaic now.
poulpy123•7m ago
I'm not really convinced that having a few more libraries in the standard library or decentralizing the library repository is going to change much the risks
kerblang•5m ago
I really like the idea of implementing the std lib separate from the language. I think that would be a huge blessing for Java, Go and others, ideally allowing faster iteration on most things given that we usually don't need a reinvention of the compiler/runtime just to make a better library.

The Hypercurious Mind

https://aeon.co/essays/how-the-hypercuriosity-of-adhd-may-have-helped-humans-thrive
1•supermdguy•29s ago•0 comments

Indian Government seeks X Community Notes oversight with IT Rules tweaks

https://www.hindustantimes.com/india-news/government-seeks-x-community-notes-oversight-with-it-ru...
1•LordAtlas•2m ago•0 comments

Cypress vs. Playwright: Architecture Deep Dive

https://yatsushi.com/blog/cypress-vs-playwright/
1•jumbosushi•2m ago•0 comments

A New Wakamai Fondue

https://pixelambacht.nl/2026/a-new-wakamai-fondue/
1•robin_reala•3m ago•0 comments

A discrete structural grammar for financial markets – Kaggle competition

https://www.kaggle.com/competitions/ska-crypto-trading-bot-with-binance
1•quantiota•4m ago•0 comments

Two hundred chimpanzees are embroiled in a 'civil war'

https://www.scientificamerican.com/article/two-hundred-chimpanzees-are-embroiled-in-a-civil-war/
2•gscott•5m ago•0 comments

Peers vote to ban pornography depicting sex acts between stepfamily members

https://www.theguardian.com/society/2026/apr/10/porngraphy-depicting-sex-acts-between-stepfamily-...
3•azalemeth•5m ago•0 comments

BMW iX5 Hydrogen Gets New Flat Tank System, Range Up to 750 Km

https://www.bmwblog.com/2026/04/08/bmw-ix5-hydrogen-flat-tank-system-750-km-range/
1•akyuu•7m ago•0 comments

The AWS Lambda 'Kiss of Death'

https://shatteredsilicon.net/the-aws-lambda-kiss-of-death/
2•tkyjonathan•8m ago•1 comments

Ask HN: What Are You Working On? (April 2026)

1•niyazpk•8m ago•0 comments

Detecting multiple cancers and other diseases from a single blood sample

https://medicalxpress.com/news/2026-04-multiple-cancers-diseases-blood-sample.html
1•gmays•10m ago•0 comments

The Global Wildlife Trade Is Fueling the Spread of Viruses

https://e360.yale.edu/digest/wildlife-trade-disease
1•speckx•11m ago•0 comments

Show HN: I built an AI pipeline to turn Infosec talks into readable, quick blogs

https://greptalks.ai
1•csima•12m ago•0 comments

They thought Iran has no air defence

https://megam226.substack.com/p/they-said-iran-had-no-air-defenses
1•megam226•13m ago•0 comments

Engineering a Better Java Build Tool [video]

https://www.youtube.com/watch?v=OtsJ902k458
1•lihaoyi•14m ago•0 comments

Europe funds our brainwashing (Proton CEO warns) [video]

https://www.youtube.com/watch?v=RTCkiWju46o
1•chriswep•14m ago•0 comments

Built something I don't even know how to position anymore

https://www.indiehackers.com/post/built-something-i-don-t-even-know-how-to-position-anymore-dfbb5...
1•Damjanmb•15m ago•0 comments

Industrial design files for Keychron keyboards and mice

https://github.com/Keychron/Keychron-Keyboards-Hardware-Design
16•stingraycharles•17m ago•1 comments

Deep Thought: A Conversation with Wolf Biermann – Arte.tv Documentary

https://www.youtube.com/watch?v=7KG4_6vy3P4
1•doener•18m ago•0 comments

New Vulnerabilities in IBM WebSphere Liberty Can Lead to Full Server Compromise

https://www.oligo.security/blog/new-websphere-liberty-vulnerabilities
1•curmudgeon22•19m ago•0 comments

TurboQuant Pro – 27-41x embedding compression via PCA-Matryoshka

https://github.com/ahb-sjsu/turboquant-pro
2•ahb-sjsu•19m ago•0 comments

Claude Code is a vibe-coded mess. Some of it is good

https://blog.raed.dev/posts/claude_code_clever_ideas/
5•Raed667•20m ago•1 comments

Xclif: The file routing-based CLI framework

https://github.com/ThatXliner/xclif
1•thatxliner•20m ago•0 comments

Meta Pauses Work with Mercor After Data Breach Puts AI Industry Secrets at Risk

https://www.wired.com/story/meta-pauses-work-with-mercor-after-data-breach-puts-ai-industry-secre...
1•gmays•20m ago•0 comments

Deconstructing a Black Hole in a Fragment Shader

https://vaidikv.github.io/deconstructing-a-black-hole/
2•apson•22m ago•1 comments

WildDet3D: Scaling Promptable 3D Detection in the Wild

https://allenai.github.io/WildDet3D/
1•aanet•23m ago•1 comments

Show HN: Electric Minds Reborn: pioneering virtual community, on a new platform

https://electricminds.org
1•amysox•23m ago•0 comments

Show HN: I'm building an open platform to submit, rate and discover lectures

3•blackbrokkoli•26m ago•0 comments

The AI Industry's Most Expensive Mistake

https://www.thealgorithmicbridge.com/p/inside-the-ai-industrys-most-expensive
2•dev_tty01•26m ago•0 comments

What is it like to be a human being?

https://iai.tv/articles/what-is-it-like-to-be-a-human-being-auid-3544
1•rrwilla•28m ago•1 comments