skip to content

A crate version is yanked from crates.io after a bad release — what does yanking promise, and what does it not do?

level: middleimportance: should knowfreq 50%

answer

  1. it withholds, it does not remove
  2. future resolutions only
  3. pins, caches and images are untouched
  4. nobody gets an email
  5. reversible by design

basics

~20 s

Yanking stops the version being chosen by any new dependency resolution, but it deletes nothing: the files stay downloadable, projects that already pin it keep building, and nobody is notified. It prevents new adoption; it is not a recall.

solid answer

~50 s

A yank is a withhold-from-selection flag, not a deletion. New resolutions will not pick the yanked version, so nobody lands on it accidentally from a version range, and that is the whole of the promise. Everything already on it is untouched: a project whose lockfile pins the version resolves and builds exactly as before, the tarball is still downloadable at the same checksum, mirrors and caching proxies keep serving their copies, and container images built last week still contain the code. No consumer is emailed. The action is also reversible, which is deliberate for the accidental-bad-release case. So a yank is a preventive control aimed at future adopters, not a remediation for current ones — the thing that actually moves people already on the version is a published advisory keyed to the affected range, which scanners and update bots act on automatically.

go deeper

for a junior

Know that yanking is not deleting: the version stays downloadable and existing projects keep building. It only stops the version being picked by a fresh resolution.

for a middle

Explain who is and is not covered — pinned lockfiles, mirrors, caching proxies and already-built images are all untouched — and that the flag is reversible by design.

for a senior

Demonstrate the full response pattern: fixed version first so consumers have a destination, then the yank to stop new adopters, then an advisory keyed to the affected range so tooling reaches those already exposed.

for a principal

Be ready to argue why registries deliberately favour a reversible flag over deletion — the ecosystem-wide cost of breaking pinned builds and rebuilds outweighs the near-zero containment that removal actually buys.

## What a yank is A yank marks a published version as no longer eligible to be selected by dependency resolution, while leaving the version itself in place. crates.io calls it yank; PyPI has the same idea for a release or a file. It is deliberately a middle setting between "attach a warning" and "take it away", and it is reversible — un-yanking restores eligibility. The promise is narrow and worth stating precisely: **from now on, a resolution that is free to choose will not choose this version.** That is it. Every other thing you might hope a withdrawal does, it does not do. ## Who is actually protected Only people who have not adopted the version yet. - A project that pins the exact version in a lockfile keeps resolving it and keeps building. This is not a bug; the guarantee that a lockfile keeps producing the same build is worth more than your ability to interrupt it, and breaking it would turn your bad release into an outage for everyone downstream. - The files stay downloadable at the same checksum. Anyone with the exact version can still fetch it — including an attacker who wants a copy of what you published. - Mirrors, internal caching proxies and vendored copies are unaffected. They hold their own bytes and generally have no notion of an upstream yank at all. - Anything already built — a container image, a compiled binary, a deployed service — contains the code and is not touched by a registry flag. - Nobody is notified. There is no push to dependent maintainers. So an hour after the yank, the population still running the bad code is *identical* to the population before it. The exposure has been capped, not reduced. ## Preventive, not remedial — and why that framing matters It helps to sort your options by which direction in time they act: | Control | Acts on | Effect | |---|---|---| | Yank | future resolutions | new adopters skip the version | | Advisory for the affected range | current consumers | scanners flag it, bots open updates | | Fixed replacement version | current consumers | gives them somewhere to go | | Deletion | future downloads of any kind | breaks pinned builds and rebuilds | An incident response that consists only of a yank has covered exactly one column. The complete reflex is: publish the fix first so there is a destination, yank the bad version so nobody new lands on it, and publish an advisory keyed to the affected version range so the people already on it are told by their own tooling rather than by luck. ## Why yank rather than delete Deletion looks stronger and mostly is not. It does not reach any of the copies listed above, so it does not contain anything that was in the artifact. What it *does* reliably do is break every pinned build and every rebuild that references the version — including, awkwardly, a rollback to a known-good state that happens to include it in its dependency graph. That is why registries push hard toward the reversible flag and fence deletion behind narrow policy, and why some registries offer no deletion at all. Deletion earns its place in one situation: when the artifact's continued availability is itself the hazard. A package containing malicious code or a live credential is not something you want strangers able to fetch on demand, even though removing it will not undo the copies already made. ## Reversibility, and the one place it misleads Yank being reversible is a feature — a maintainer who yanks a release on a false alarm can undo it in seconds. But do not let the reversibility of the flag suggest reversibility of the publication. Anything that was ever public should be assumed permanently public: it was fetched, mirrored, indexed and archived within minutes. If the reason for the yank is that the version carried a secret or a backdoor, the yank is bookkeeping and the real work is elsewhere — revoking the credential, or getting the affected range in front of every consumer's scanner. ## How to answer this in an interview State the promise in one sentence, then enumerate who is *not* covered — pinned lockfiles, caches and mirrors, prebuilt images, and everyone who is simply never notified. Finish with the pairing: a yank is one third of the response, alongside a fixed version and an advisory. Candidates who describe a yank as "pulling the version" and stop there are describing a recall that does not exist.

  • You have yanked the bad version. What actually reaches the teams already running it?
    A published security advisory keyed to the affected version range. Vulnerability scanners and update bots consume advisory feeds and will flag or auto-open an upgrade in each affected project, which is the only mechanism here that pushes rather than waits. Registry flags are pull-only: they reach a consumer solely at the moment that consumer happens to resolve fresh.
  • Is a yank reversible, and does that reversibility mean anything for a compromised release?
    The flag is reversible — un-yanking restores the version, which is deliberate for a false alarm or an over-hasty yank. But it says nothing about the publication itself. Anything that was public for even minutes was fetched, mirrored and archived, so a version that carried a secret or malicious code should be treated as permanently public regardless of the flag's state.
  • Why not just delete the version instead of yanking it?
    Deletion does not reach mirrors, caches, vendored copies or built images, so it contains almost nothing, while it reliably breaks pinned builds and rebuilds — potentially including a rollback you need. Reserve it for artifacts whose availability is itself the hazard, such as malicious code or a live credential, and use the reversible flag otherwise.

It is like taking a product off the order form while every unit already shipped stays in customers' hands and the warehouse still fills an order that names the exact part number.

saying these in an interview costs you the question

  • Says yanking deletes the version from the registry
  • Believes yanking notifies dependent maintainers
  • Expects a yank to break existing pinned builds
  • Forgets caching proxies and prebuilt images still serve it
  • Treats the yank as the end of the incident

context