惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
J
Java Code Geeks
有赞技术团队
有赞技术团队
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
Microsoft Security Blog
Microsoft Security Blog
IT之家
IT之家
G
Google Developers Blog
月光博客
月光博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
S
SegmentFault 最新的问题
博客园 - 三生石上(FineUI控件)
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - Franky
腾讯CDC
V
Visual Studio Blog
博客园 - 【当耐特】
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
L
LangChain Blog

Hacker News: Front Page

SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Introducing Claude Opus 4.7 Qwen Studio The Future of Everything is Lies, I Guess: Where Do We Go From Here? GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh Virginia Bans Sale of Geolocation Data Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis Ancient DNA reveals pervasive directional selection across West Eurasia [pdf] AI cybersecurity is not proof of work Moving a large-scale metrics pipeline from StatsD to OpenTelemetry / Prometheus GitHub - Nightmare-Eclipse/RedSun: The Red Sun vulnerability repository GitHub - SethPyle376/hiraeth: Local AWS emulator focused on fast integration testing, with SQS support, SQLite-backed state, and a debug-friendly web UI. A Better Ludum Dare; Or, How to Ruin a Legacy GitHub - macOS26/Agent: Any AI, replaces Claude Code, Cursor, OpenClaw. Over 18 LLM providers (Claude, OpenAI, Gemini, Ollama, Zai, HF, Qwen) wired into a native Mac app that writes code, builds Xcode projects, bumps versions, manages git, automates Safari, use AppleScript, JS or Accessibility, extend Agent! w/ MCP Servers, run tasks from your iPhone via Messages. YouTube now lets you turn off Shorts I Made a Terminal Pager Burgers | マクドナルド公式 Commands — HackerNews CLI documentation ChatGPT for Excel PiCore - Raspberry Pi Port of Tiny Core Linux Live Nation illegally monopolized ticketing market, jury finds Google Broke Its Promise to Me. Now ICE Has My Data. Founding Engineer at Adaptional | Y Combinator CRISPR takes important step toward silencing Down syndrome’s extra chromosome GitHub - saffron-health/libretto: The AI toolkit for building reliable browser automations US v. Heppner (S.D.N.Y. 2026) no attorney-client privilege for AI chats [pdf] Unexpected €54k billing spike in 13 hours: Firebase browser key without API restrictions used for Gemini requests Fragments: April 14 Cal.com Goes Closed Source: Why AI Security Is Forcing Our Decision | Cal.com - Scheduling Software for Online Bookings Laravel raised money and now injects ads directly into your agent
No one owes you supply-chain security
2026-04-12 · via Hacker News: Front Page

Lobsters Reddit Hacker News

In case you’re unaware, I’m not a developer. I’m actually an autistic catgirl annoyed by suboptimal use of computing power, and fixing that happens to involve programming. Crucially, it also includes discussing foundational technology with people behind the scenes, and apparently that makes me more aware of social aspects of this sphere.

So, I have opinions about criticism of crates.io for supply-chain attacks. After a dozen similar articles, I have some select words to voice about why it’s off the mark.

Typo-squatting

Before I cover the main point, let’s talk about about how supply-chain attacks happen in the first place, and why some common ideas for fixing them don’t work out.

There are multiple reasons when a malicious dependency is added to a project. The least discreet reason this can happen is typo-squatting. It happens when a malicious library has a name similar to a real library, e.g. num_cpu vs num_cpus. Commonly cited solutions include using direct URLs or namespacing.

Well, let’s see if that helps. Say you get a PR adding the following lines to Cargo.toml:

[dependencies]
bitflags = { git = "https://github.com/bitflags/bitflags" }
itertools = { git = "https://github.com/itertools/itertools" }
rand_core = { git = "https://github.com/rust-random/rand_core" }

One of these URLs is fake. Can you tell which one? It’s itertools – the correct URL is https://github.com/rust-itertools/itertools. https://github.com/itertools is a random account. https://github.com/rust-bitflags is not registered at all, by the way.

If you think you can remember the URLs for each package you use, you’re probably wrong. Since many crates are managed by GitHub organizations, not individuals, it isn’t even enough to remember that you can (likely) trust dtolnay and BurntSushi. Though this still isn’t conservative enough – https://gitlab.com/BurntSushi is free and and https://glthub.com is on sale, so attackers have plenty other choices.

By making crate IDs longer, whether by namespacing within crates.io, GitHub organizations, or via domains, you only make it harder for users to remember them precisely, and thus harder to recognize typo-squatting.

Sandboxing

Rust gives build scripts and procedural macros full access to your PC. Worse, rust-analyzer runs cargo check when you open the project directory, so it can effectively become a 0-click RCE.

Some people tried to solve this. There’s an open issue for build.rs sandboxing, and there were some experiments about compiling procedural macros to WebAssembly.

But this is hardly workable. While cargo build can become safe, you usually run cargo test or cargo run immediately afterwards, which is impossible to sandbox. Making Rust development secure involves more than build time and requires powerful system-level isolation that cargo alone cannot be responsible for.

Code in VCS

An oft brought-up issue is that the code on crates.io and in Git don’t always match.

To begin with, this is not trivial to solve. You can’t just turn crates.io into a DNS, mapping crate names to repository URLs, since crates.io is designed to avoid giving crate maintainers the ability to break downstream consumers by deleting stuff:

One of the major goals of crates.io is to act as a permanent archive of crates that does not change over time, and allowing deletion of a version would go against this goal.

This restriction was likely set due to the left-pad incident, when a popular library was deleted from npm, breaking CI builds. npm could quickly fix this because it’s centralized. Thin crates.io wouldn’t stand a chance, so it saves and serves copies.

crates.io could still pull files from the repo on cargo publish. But if the maintainer can just force-push afterwards, it’s not a good security mechanism.

Maybe crates.io could periodically scan repositories for history changes. But what does that mean exactly? Does removing the release commit from master, but keeping it on a tag count? What if I host the repo on a custom forge, which serves one history to the crates.io User-Agent and different history to the rest of us?

Or maybe there’s a good reason to have different code in Git and crates.io. If the crate contains autogenerated code, you should probably generate it in CI on release. Wouldn’t want to run expensive codegen in build.rs on each install, would you?

Every option has downsides: they can break existing packages or have false-positives on benevolent rewrites. I’d still like cargo audit to scan repositories, but it can’t be a hard limit, and that means it can be designed around.

Moderation

All these issues have an unacknowledged shared assumption that keeping malicious code off crates.io is “Rust’s” responsibility. That if you decide to use a dependency and then cargo add totally-safe-package steals your credentials, it’s an inherent fault of crates.io. Which is really misplaced if you think about how Rust is developed.

I’m sure many of you use open-source software and remember the MIT license:

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, […], FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. […]

This applies just as much to Rust. Despite its popularity, Rust is not sponsored by large companies, like Microsoft or RedHat, in the same sense that GitHub or Linux are. The compiler and std are primarily developed by volunteers, who don’t get anything out of it except for rare donations from other members of the community.

The fact that this scheme works at all is ridiculous to me. Perhaps it’s so unbelievable, that people think there’s secret employment in Rust Foundation or something, when in fact it only paid four software engineers in 2024, excluding grants.

So it feels bonkers to me when people say they know a solution to supply-chain attacks, such as (underline the correct variant):

  • Making Linux distro maintainers responsible instead (duplicating work).
  • Sandboxing as much as possible (which is to say, not a lot and not by much).
  • Moving stuff into the standard library (overloading T-libs more than it already is).
  • Your other favorite technical solution.

Futilely fixing societal problems with technology is every developer’s forte, but let’s just be real for a second. The issue is the lack of manpower, not that no one made a nice GUI for blockchain-powered Web of Trust yet, or whatever.

We’re not nearly close to the level of security a centralized registry can provide. On the software side, in 2025 Rust teams made or piloted tools for typo squatting detection, dynamic build script analysis, and real-time code scanning. On the personal side, Rust Foundation hired on-call engineers in 2025 and a second infrastructure engineer in 2026. If that sounds overdue, well, they had net loss in 2023 – software isn’t cheap.

You can’t expect the same level of security from a small, pre-moderated, stable-release, private-funded registry, like Ubuntu’s, and a large, post-moderated, rolling-release, mostly-voluntary registry. The scale doesn’t compare, and suggesting that complicating an overworked team’s job will resolve the issue is just insulting.

Audit

What I’m saying is that you’re responsible for auditing the crates you use. Maybe that’s not how it’d work in a perfect world, but in our capitalist hellscape no one else can be argued to be accountable for this, which leaves you, the crate user.

And Rust gives you all the tools for this.

Lockfiles limit installation to verified versions. cargo add <dep>@<version> installs the crate at a specific version. cargo-vet can be useful. crates.io shows a 90-day download plot, which is difficult for malicious crates to simulate, and is responsive to malware reports via email. If you’re feeling adventurous, you can check the submitted crate sources by clicking “browse source” in the crate’s sidebar. A quick check covers most simple attacks. cargo update --dry-run shows the list of outdated crates without actually updating dependencies so that you know which ones to recheck.

For sandboxing, cargo-chef is the most straightforward way to sandbox builds, aside from Nix isolation. Supporting rust-analyzer and cargo run is trickier, but I suspect you can often just use firejail. Bonus points if someone shares their script for this!

Few of us are security researchers, but in all fairness, much of it is common sense and a little curiosity. And if you don’t audit code, then who will?