jdx/mise · critical

the stamp list from for has sequence , below the already…

Error message

the stamp list from {host} for {project} has sequence {sequence}, below the {last} already accepted; refusing what may be a rollback

What it means

Raised by packslip_stamps::check_sequence_in when a freshly fetched stamp list has a sequence number lower than the highest sequence already accepted from that host for the project. This is rollback protection: an attacker (or a compromised/regressed mirror) replaying an old list could re-advertise yanked releases, so mise rejects any sequence below the recorded one.

Solutions

  1. Obtain a stamp list with the current (>= last accepted) sequence from the host — ask the publisher to publish/resign with a higher sequence.
  2. Refresh from the canonical host URL rather than a stale mirror or cache.
  3. If the rollback is legitimate (deliberate publisher decision), explicitly clear the local per-host sequence state after verifying with the publisher, then re-accept.
  4. Investigate possible compromise — a lower sequence from the same host is a classic replay/rollback attack signature.

Example fix

// server-side before: resigned list with sequence 5 after clients accepted 7
// after: publish with sequence 8
// (client-side: re-fetch from the canonical URL once the list is republished)
Defensive patterns

Strategy: retry

Validate before calling

// compare fetched sequence against locally accepted before applying
const state = readHostState(dir, host);
const last = state.sequences?.[project];
if (last !== undefined && list.predicate.sequence < last) {
  throw new Error(`rollback detected from ${host}: ${list.predicate.sequence} < ${last}`);
}

Type guard

function isMonotonic(list, acceptedSequence) {
  return acceptedSequence === undefined || list.predicate.sequence >= acceptedSequence;
}

Try / catch

try {
  applyStampList(host, project, list);
} catch (e) {
  if (String(e).includes("below the") && String(e).includes("rollback")) {
    // treat as a security signal: re-fetch from the canonical host, investigate the mirror
    refetchFromCanonical(host, project);
  } else throw e;
}

Prevention

When it happens

Trigger: Calling check_sequence during a stamp-list fetch/refresh when state.sequences[project] exists and list.predicate.sequence < last — i.e. the signed list carries an older sequence number than what this machine already accepted from that host.

Common situations: A compromised or rolled-back mirror serving an old signed list; the publisher accidentally re-signing with a lower sequence; restoring old server-side state; switching between hosts/CDNs that have divergent sequence counters (though this check is per-host).

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/6c964ea6ecbfd4f3. Report an issue: GitHub.

Appendix: source

Thrown at src/packslip_stamps.rs:259

        bail!(
            "{host} published a stamp list for {project} before (sequence {last}) but now answers 404 at {url}; refusing to treat that as no list, since it would drop the yanks that list carried"
        );
    }
    Ok(())
}

fn check_sequence_in(
    dir: &Path,
    host: &str,
    project: &str,
    list: &ReleaseListStatement,
) -> Result<()> {
    let mut state = read_state(dir, host)?;
    let sequence = list.predicate.sequence;
    if let Some(&last) = state.sequences.get(project)
        && sequence < last
    {
        bail!(
            "the stamp list from {host} for {project} has sequence {sequence}, below the {last} already accepted; refusing what may be a rollback"
        );
    }
    if state.sequences.get(project) != Some(&sequence) {
        state.sequences.insert(project.to_string(), sequence);
        write_state(dir, host, &state)?;
    }
    Ok(())
}

/// Fetch and verify every trusted host's list for a project. `None` when
/// no stampers are configured or the tool trusts its vendor alone. A host
/// that has no list for the project stamps nothing; one whose list fails
/// to verify is an error, since silently ignoring it would let a broken
/// host widen what another admits.
pub(crate) async fn fetch(project: &str, opts: &ToolVersionOptions) -> Result<Option<Stamps>> {
    if trusts_vendor(opts) {
        return Ok(None);

View on GitHub (pinned to 533346cc37)