All news
VIBPS / NEWS • SOFTWARE SECURITY

Can a decision model flag malicious Rust crates? What the early scan found

A Rust Foundation experiment scanned 135,548 crate files and surfaced four known malicious crates. Its threshold results show the false-alert tradeoff, while unknown misses and unresolved cases remain.

The Rust Foundation is testing whether a small “decision model” can score newly published crates for signs of deliberate malware, then send only high-scoring candidates to people for review. In an update posted November 23, the foundation said the experiment had scanned 135,548 crate files published from November 11 through 21 and had surfaced four crates already known to be malicious.

The Foundation calls the model a decision model because it returns a bounded score rather than an open-ended explanation. That makes it fast and cheap enough, in the Foundation’s estimate, to scan a large registry stream. The initial trial is exploratory: after an earlier sample of about 1,000 crate files, the team began a broader scan intended to cover November and December.

Why did the threshold matter?

The system scores how likely a crate appears actively malicious on a 0-to-1 scale. At a threshold of 0.35, the Foundation’s table lists 332 crates, four true positives and 240 false positives. Raising the threshold reduced the number sent for attention: at 0.7, 15 crates included the same four known positives and six false positives; at 0.9, four were listed, all four true positives and no false positives in this small observed set.

Those figures do not establish a reliable detection rate. The Foundation says it cannot yet measure false negatives because it cannot manually review the entire registry, malicious crates are rare, and later reports may take months to arrive. A zero-false-positive row for four known cases is not proof the model catches every harmful package. The model, prompt and threshold are specific to this experiment, and the Foundation says embedded binary data can make the model over-score a crate.

What happens when a crate is flagged?

The scan does not automatically remove packages or block publication. A crates.io team member or Rust security initiative member reviews the file; any takedown follows the normal registry process, with RustSec advisories where appropriate. The scanner does not retain crate file contents after the first analysis. It keeps the crate name, version, file list and score, according to the post.

Human review is essential for both safety and fairness. A score can help prioritize a large stream, but the project has not demonstrated that it can separate every unusual but legitimate package from malicious code. Its current threshold is meant to balance review volume against known findings, and the Foundation plans to revisit false negatives as more reports accumulate.

For package maintainers, the practical point is that automated triage can add another signal alongside provenance, maintainer changes and capability analysis. It cannot replace secure build and release practices or a clear incident response. The Foundation says it will examine the experiment more deeply in January and may compare other models or prompts before deciding whether to continue.

This is different from a report about one compromised package: VIBPS has covered the malicious crm-connect releases as an incident response story. The Rust Foundation post is about a possible continuous screening layer for the crates.io firehose, including how human review and threshold choice fit together.

What did the malicious @leadstack/crm-connect npm package do?

How to design an AI code review system maintainers can trust

Rust Foundation: Needles, Haystacks, and Numbers Between 0 and 1

RustSec advisory database

More software stories, with sources and context.

More news