Unforged

Trust the source, not the server: a Firefox extension that blocks dapp code nobody rebuilt.

Unforged

Created At

ETHGlobal Mumbai

Project Description

In February 2025, Bybit lost $1.5B to a single changed JavaScript file. Safe's GitHub repo was clean. The contracts were audited. The signers approved exactly what their screen showed them. The attack lived in the one place nobody checks: the gap between the code a dapp publishes and the bytes its server actually sends.

Unforged checks that gap, in your browser, before any code runs.

Independent builders rebuild every release of a dapp from its public repository and sign what they got to Arkiv. Our Firefox extension hashes every page, script, stylesheet and config file as it arrives. If k builders produced those exact bytes, it runs. If not, it's blocked before it can build a single transaction, and you see precisely what was changed. One click opens the genuine release from a mirror, every file re-checked, so a compromised site doesn't lock you out of your dapp.

No cooperation from the dapp. No trust in its servers, DNS, CDN or signing keys. Anyone can become a builder by forking our repo and running a GitHub Action.

It's live today. Lido's staking widget, 170 files, rebuilt independently in Docker on a laptop and on a GitHub Actions runner, with separate keys and identical bytes, under a 2-of-2 policy on Arkiv. In our demo, a Bybit-style file swap makes MetaMask ask to send your ETH to the attacker. With Unforged installed, that page never runs. Injected scripts, cloned sites from DNS hijacks and tampered config are blocked the same way.

And it scales to real dapps. Since 2021, 17 front-end attacks have cost $1.63B, and 99.8% of that hit dapps whose source code was public. We rebuilt 13 major frontends: 4 of the 7 that build are byte-identical as published, and 3 more with small fixes.

Trust the source, not the server.

How it's Made

Unforged is a TypeScript monorepo (MIT) with 469 automated tests, in five parts.

  1. Core library. Canonical JSON, SHA-256 manifests (path → hash for every built file), in-toto Statement v1 attestations signed with EIP-191 via viem, and the acceptance rule: a release counts only when k distinct allowlisted builders signed the same manifest root, each signature recovers to the entity's creator, and the manifest re-hashes to that root.

  2. Builder CLI and GitHub Action. A YAML recipe pins the repo, commit, Node and package-manager versions, build command and output directory. The CLI clones at a fixed absolute path (we found some bundlers leak the checkout path into chunk names), builds, hashes, signs and publishes. The Action runs the same steps on a fresh GitHub runner with the builder's own key from repo secrets, and refuses to sign if its root differs from what other builders got. A full Lido rebuild, attest and publish takes about 3 minutes on a free runner.

  3. Arkiv as the registry. There is no Unforged server. Attestations and curator policies are readonly entities on Arkiv's Rabdi testnet (SDK 1.0), owned by the signer's key, with indexed attributes (dapp, release, commit, manifest_root, version) and a gzipped signed payload carrying the whole manifest. The extension syncs everything keyless over the public RPC, filtered by creator: only the curator's policies, and only attestations from builders a policy names. Policies are signed over {policy, version}, so even a dishonest RPC can't forge or relabel them. Arkiv's ownership, readonly flags and creator queries are exactly the trust model we needed; on our own database, we could have forged any builder's statement. One attestation costs about 0.0019 test GLM.

  4. Firefox extension (Manifest V3). webRequest.filterResponseData buffers each response, hashes it and either releases the bytes or blocks them and moves the tab to an explanation page, failing closed. The first document locks the tab to one release so files can't be mixed across releases. Config files must match a hash pinned in the signed policy, because a valid-looking value (Lido's ipfsMode flipped to true) can still be hostile. The blocked page shows a diff against the genuine file; "Open verified copy" loads the release from any static host, re-hashing every file, so the mirror needs no trust and plain HTTP costs privacy, not integrity. Sync is bulk, never per visit, so nobody learns which dapp you open.

  5. Demo and docs. A local server replays three real attack patterns against the real Lido build: a single swapped file (Bybit), an injected script (BadgerDAO, KyberSwap) and a cloned site (Curve, CoW Swap). The docs site is Docusaurus reading the repo's markdown in place.

Hacky and notable: making our demo attack work taught us something about attackers. Lido's MetaMask connector sends transactions over MetaMask's newer multichain postMessage channel, not window.ethereum, so a defence that only watches the injected provider would miss it. Blocking the code before it runs doesn't care which path the transaction takes. We also ran a pre-event reproducibility study on 13 dapps (fresh caches, Turkish locale, UTC+14, one CPU core), which is how we knew Lido would rebuild byte for byte before writing a line of the extension.

background image mobile

Join the mailing list

Get the latest news and updates