JuliusBrussee/caveman · critical · Error

signature check failed for checksums.txt — refusing to…

Error message

signature check failed for checksums.txt — refusing to install

What it means

Before trusting checksums.txt, `ensureBinary` also downloads `checksums.txt.keysig` and passes both to `signedDigest(checksums, signature)`, which verifies the signature (e.g. minisign-style signed digest). If verification fails, the installer refuses to install — treating the manifest as tampered, forged, or unparseable. This is the supply-chain trust root for the whole download.

Solutions

  1. curl both `${release}/checksums.txt` and `${release}/checksums.txt.keysig` and confirm they are the expected plain-text manifest and signature, not an HTML error page.
  2. Clear any intermediate cache/proxy (or fetch with cache-busting) so the manifest and signature come from the same release.
  3. If the release was legitimately re-signed, update to an installer version that trusts the new key.
  4. Check that you are hitting the official release host and not a mirror that alters content.
  5. As a last resort, install the binary manually and export the envVar override.

Example fix

// before: mismatched cached pair
// checksums.txt (v1.2.0) + .keysig (v1.1.0) -> verification fails
// after: bust cache and refetch the consistent pair
curl -H "Cache-Control: no-cache" "$RELEASE/checksums.txt" -o checksums.txt
curl -H "Cache-Control: no-cache" "$RELEASE/checksums.txt.keysig" -o checksums.txt.keysig
Defensive patterns

Strategy: try-catch

Validate before calling

const [txt, sig] = await Promise.all([
  fetch(`${release}/checksums.txt`).then(r => r.text()),
  fetch(`${release}/checksums.txt.keysig`).then(r => r.text()),
]);
if (!txt.startsWith("untrusted comment") && !/^[a-f0-9]{64} /m.test(txt)) {
  throw new Error("checksums.txt or signature looks wrong (proxy/portal page?)");
}

Try / catch

try {
  await ensureBinary({ name, envVar });
} catch (e) {
  if (String(e.message).includes("refusing to install")) {
    // treat as potential tampering: do NOT bypass silently
    console.error("Signature verification failed; verify release host and proxy, then retry.");
    throw e;
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling `ensureBinary()` when `signedDigest(checksums, signature)` returns falsy: signature file content doesn't verify against the embedded public key, the .keysig download returned an error page (which then fails parsing as a signature), the manifest was regenerated with a different signing key, or a proxy altered the manifest bytes in transit.

Common situations: Corporate TLS-intercepting proxies modifying response bodies; release re-signed with a rotated key while installed copies still verify the old key; captive portal/auth pages served for the .keysig URL; CDN caching a checksums.txt from one release with the .keysig of another (mismatched pair fetched via cached URLs).

Understand the failure class

Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.

Related errors


AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20). Data as JSON: /api/errors/c648d9ed22326c07. Report an issue: GitHub.

Appendix: source

Thrown at packages/shared/binary-installer/installer.mjs:198

  }
  const found = onPath(name);
  if (found) return found;
  const binDir = join(process.env.CAVEMAN_HOME ?? join(homedir(), ".caveman"), "bin");
  const target = join(binDir, binaryInstallFilename(name));
  if (executable(target)) return target;

  const { os, arch } = targetPlatform();
  const artifact = `${name}_${os}_${arch}`;
  const base = (process.env.CAVE_BINARY_RELEASE_BASE ?? BINARY_RELEASE_BASE_DEFAULT).replace(/\/+$/, "");
  const release = `${base}/${BINARY_RELEASE}`;
  const timeout = timeoutMs();
  const [checksumsResponse, signatureResponse] = await Promise.all([
    asset(`${release}/checksums.txt`, timeout),
    asset(`${release}/checksums.txt.keysig`, timeout),
  ]);
  const [checksums, signature] = await Promise.all([checksumsResponse.text(), signatureResponse.text()]);
  if (!signedDigest(checksums, signature)) {
    throw new Error("signature check failed for checksums.txt — refusing to install");
  }
  const expected = expectedDigest(checksums, artifact);
  mkdirSync(binDir, { recursive: true });
  // Per-process part path, and NO pre-unlink. A fixed `${target}.part` plus a
  // cleanup() immediately before an O_CREAT|O_EXCL open made the exclusivity
  // guard unreachable: two concurrent installs (npx -y caveman-mcp is registered
  // per MCP session, so several agents can start one at once) raced — B unlinked
  // A's directory entry and created its own inode, A hashed ITS OWN bytes and
  // matched, and then the PATH-based chmod+rename published B's half-written file
  // as "checksum verified". Both the chmod and the rename now act on a name only
  // this process can own.
  //
  // ponytail: a SIGKILL mid-download now leaves one stray .part behind instead of
  // reusing the fixed name. Sweep binDir for stale .part files if that ever shows
  // up in the wild.
  const part = `${target}.${process.pid}.${randomBytes(6).toString("hex")}.part`;
  try {
    const actual = await download(`${release}/${artifact}`, part, timeout);

View on GitHub (pinned to 3ee70a1026)