Skip to content
Innovation & Growth

Rust's Cargo adds an opt-in waiting period for new dependencies

Rust 1.100 is due to let teams hold back fresh releases so defenders can catch bad ones. It is off by default.

W
WebPulse Newsroom
AI-assisted · 4 min read
Share on X LinkedIn
Rust's Cargo adds an opt-in waiting period for new dependencies
In brief
  • Socket reports that Cargo's waiting-period setting is scheduled to become stable with Rust 1.100 on November 12. Teams can skip dependency releases newer than an age they choose.
  • The default wait is zero. The check does not cover cargo install, Git or local path dependencies, so protection depends on a deliberate setting.
  • Leaders should ask whether Rust teams have set a cooldown, who approves urgent exceptions, and which build paths fall outside it.

Most defences against bad software packages try to spot the bad code faster. Rust's newest option takes another route: it makes the team wait. The lesson here is that a delay can work as a security control. But a control that is off by default only protects the organisations that switch it on.

Socket reports that a waiting-period setting in Cargo, Rust's package manager, is scheduled to become stable with Rust 1.100 on November 12. A team can tell Cargo to ignore any dependency release younger than an age it picks. The change was merged on August 28, and beta already has it. The default age is zero. Upgrading alone adds no waiting time.

Why under two hours was still too long

In August, attackers published tampered versions of three Rust libraries, called crates: arrayref, internment and append-only-vec. Socket documented the incident. Each one pulled in a malicious crate named proc-macro1. Its build script fetched a payload. A build script is code that runs while software is being assembled.

According to the Rust Security Response Team, each version stayed public for a short time: 86 minutes for arrayref, 90 for internment and 107 for append-only-vec. That is quick. Socket's point is that updates can spread faster than an investigation. Bad code can reach laptops and automated build systems before the registry acts.

Those August releases were not the end of it. In September, the crates.io team and Rust security responders issued a warning about a continuing effort aimed at Rust project members and owners of widely used crates. As they described it, the approach starts with a supposed job or project offer and a video call. The target is then pushed to install software or run commands. Either step could compromise the target's device and publishing accounts. The people who hold publishing rights are the ones being approached.

How the cooldown works

A team sets a minimum age in its Cargo configuration file. Socket's example is seven days. Cargo accepts units from seconds up to months. When Cargo chooses versions, it skips anything newer than the limit. It can still pick an older version that fits the project's other needs.

If nothing old enough fits, the build stops. This is by design. The feature's proposal describes a trick: publish a bad update, then withdraw the safe versions. A rule that only preferred older releases could then land on the bad one. Socket says the August attackers withdrew genuine arrayref versions. A hard refusal blocks that path.

Cargo also says when a cooldown applies. It lists the newer versions it passed over, with their ages. Versions already in the Cargo.lock file stay, even if they are young. So switching the cooldown on does not remove a fresh release that is already locked in.

What it does not cover

Socket names the gaps. The stable version skips cargo install. It relies on publication times from the registry. So Git dependencies, local path dependencies and registries without that data fall outside it.

Waiting has a price. Real fixes wait too, unless a developer steps in. Cargo lets a developer bypass the age check for a single run and name the version they need.

Socket adds that age does not make bad code safe. A release that nobody detects can outlast the wait. What a cooldown buys is time. Researchers, maintainers and registries can respond before the next update spreads the problem further.

The work began before August. Socket says the tracking issue was opened on May 18, and nightly Cargo had the feature by June 21. On May 25, contributor Giles Cope commented on the issue. He voiced concern that AI could help attackers mount supply chain attacks. He argued that "it's far more important we get an MVP version of this out early than we gold plate it."

Questions to put to your engineering team

First, do any of our products or build systems depend on Rust crates? If so, has anyone set a minimum age? The default will not do it for us.

Second, who approves an exception when a security fix cannot wait a week? A written, fast path is better than developers improvising under pressure.

Third, which build paths fall outside the check? Ask about cargo install, Git dependencies and private registries. Then ask whether other controls cover them.

Fourth, do the people who can publish our own crates know about the job-offer approaches reported in September?

A cooldown is not a detector. It is a head start for the people who are. Whether your organisation gets that head start is a decision someone has to make.

Produced by the WebPulse Newsroom with AI assistance from the original reporting credited below, and checked against that source by our editorial review. How we use AI.
Original reporting: Socket.

Share this insight