Cordon

Seal one malicious npm version on chain, and every guard blocks it before it runs.

Cordon

Created At

ETHGlobal Mumbai

Project Description

Cordon is a circuit breaker for npm dependencies. Independent detectors each vote that one exact package version is malicious, with an evidence hash. When a quorum of distinct detector keys agrees, the SealRegistry contract marks that version Sealed. A guard then blocks it in three places: cordon install checks every lockfile entry, transitive ones included, before npm runs and installs with scripts disabled; a sidecar makes running services that depend on it fail their health check; and cordon audit finds copies already installed. Seals are per version, so 1.4.0 stays installable when 1.4.1 is sealed, and the guard proposes a rollback without editing files. If the RPC is down, the guard blocks from a signed snapshot; if our watcher is down too, from its cached copy. A false seal is an outage we caused, so the contract has a quorum, a seal rate limit, vote expiry and a dispute window before a guardian can unseal.

This is a testnet prototype on Base Sepolia (SealRegistry 0x07DCC100d48fBA912fEf3e14F61d1162596a0E8F). In the demo all three detectors and the guardian key are run by our team, the detectors are labelled simulated, and only npm lockfile v2 and v3 are supported.

How it's Made

Solidity 0.8.24 with Foundry and OpenZeppelin v5 AccessControl for SealRegistry, with frozen roles, quorum, vote lifetime, dispute window and a daily seal limit, deployed on Base Sepolia and verified on Sourcify. TypeScript on Node 22 for the guard CLI, the detectors service and the watcher, using viem, zod, Fastify and node:sqlite. The three detectors are a static reader of install scripts, a Docker sandbox that installs the package with a canary value and no real files, and an OSV lookup that counts only MAL advisories. The watcher polls the registry and the chain in parallel, signs snapshots of the Sealed list, and keeps a stopwatch from publish to first block. The dashboard is Next.js with wagmi and reads SealRegistry directly; it has a read only mode with no backend. A Chainlink CRE workflow runs the OSV check across nodes that agree on the MAL ids and writes the vote through a receiver contract; it runs in the CRE simulator only. We built it with Claude Code; docs/ai_usage.md lists every AI generated file.

background image mobile

Join the mailing list

Get the latest news and updates

Cordon | ETHGlobal