diff --git a/README.md b/README.md index 3361061..aae2442 100644 --- a/README.md +++ b/README.md @@ -190,17 +190,17 @@ These scripts install nothing. The core has zero dependencies, and Cloud and the | Property tests (G1–G5, fail closed, tightening, the SIMD-0500 gate, snapshot identity, ejection) | 26/26, with coverage counters so a vacuous pass fails | | Golden vectors (every worked example in the docs, exact boundaries, the abort binaries' bytes, loader layouts) | 119/119 identical, Rust = Python | | End to end | [Above](#what-it-does-to-an-attack) | -| On devnet | All three programs run this tree's build (PR #77, 11 Oct), matched byte for byte against CI's build of that commit, upgrade authority checked. **S1 ran there on 1 Oct**: the admin key ordered 1.2M, 100,000 left, the guardian froze and cancelled the other 11. Floor S10 with real transactions: one guardian stops, two restore byte-identical, 17/17 forbidden actions refused ([below](#live-on-devnet)) | -| What this process found in our own code and docs | **98 findings**: real bugs, two overclaimed guarantees, test gaps, deploy-tooling hazards, and two adversarial reviews' attacks. Each is fixed or stated ([`09 §4`](docs/09-VERIFICATION.md#4-what-this-process-found-every-item-fixed-or-stated)); 96–98, from a review after the submission, are stated with their fixes, which ship with the audit build. The Rust core and the Python reference shared one bug; only a third, independent statement of the rule caught it. | +| On devnet | All three programs run this tree's build (PR #85, 15 Oct), matched byte for byte against CI's build of that commit, upgrade authority checked. **S1 ran there on 1 Oct**: the admin key ordered 1.2M, 100,000 left, the guardian froze and cancelled the other 11. Floor S10 with real transactions: one guardian stops, two restore byte-identical, 17/17 forbidden actions refused ([below](#live-on-devnet)) | +| What this process found in our own code and docs | **104 findings**: real bugs, two overclaimed guarantees, test gaps, deploy-tooling hazards, and the attacks of adversarial reviews and audits. Each is fixed or stated ([`09 §4`](docs/09-VERIFICATION.md#4-what-this-process-found-every-item-fixed-or-stated)); 96–104 were found after the submission: 96–99, 101 and 103 are fixed and run on devnet since 15 Oct; 100, 102 and 104 are stated. The Rust core and the Python reference shared one bug; only a third, independent statement of the rule caught it. | ## Live on devnet -Deployed 28 Sep 2026. All three programs have been upgraded in place since then (same ids, market and seal), most recently on 11 Oct (Floor; the Vault on 10 Oct, Harbor on 6 Oct). Each runs exactly the canonical build of PR #77 (the Vault: the same bytes since PR #75; Harbor: since 6 Oct): Linux x86_64, as CI builds it and as the Solana Foundation's verifiable-build image reproduces it on any machine. CI repeats this check every week. +Deployed 28 Sep 2026. All three programs have been upgraded in place since then (same ids, market and seal), most recently on 15 Oct (Floor and Vault; Harbor on 6 Oct). Each runs exactly the canonical build of PR #85, `main` at `3eec968` (Harbor: the same bytes since 6 Oct): Linux x86_64, as CI builds it and as the Solana Foundation's verifiable-build image reproduces it on any machine. CI repeats this check every week. | Program | Devnet id | sha256 of the build | |---|---|---| -| Floor | [`HARLZqMwqocBnbhbSTWkd5i8EHmjHXLHr1T9su3SR31E`](https://explorer.solana.com/address/HARLZqMwqocBnbhbSTWkd5i8EHmjHXLHr1T9su3SR31E?cluster=devnet) | `257996d0…3d5b6a6a` | -| Vault | [`HK5FbaLtvNSPHj9HYbuStfVxXktkoMejJ9GEjn8WCY1b`](https://explorer.solana.com/address/HK5FbaLtvNSPHj9HYbuStfVxXktkoMejJ9GEjn8WCY1b?cluster=devnet) | `b0cda14c…0af96097` | +| Floor | [`HARLZqMwqocBnbhbSTWkd5i8EHmjHXLHr1T9su3SR31E`](https://explorer.solana.com/address/HARLZqMwqocBnbhbSTWkd5i8EHmjHXLHr1T9su3SR31E?cluster=devnet) | `508e5a99…c406c16b` | +| Vault | [`HK5FbaLtvNSPHj9HYbuStfVxXktkoMejJ9GEjn8WCY1b`](https://explorer.solana.com/address/HK5FbaLtvNSPHj9HYbuStfVxXktkoMejJ9GEjn8WCY1b?cluster=devnet) | `d2994425…8665544d` | | Harbor (demo protocol) | [`6w9t76W2w8q38xTvUPuDDzSwrjTKbq4dM8nAckYXScYh`](https://explorer.solana.com/address/6w9t76W2w8q38xTvUPuDDzSwrjTKbq4dM8nAckYXScYh?cluster=devnet) | `543be60b…10adeb40` | ```bash diff --git a/SECURITY.md b/SECURITY.md index 71ca517..b7fdd82 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -9,7 +9,7 @@ | `bulkhead-core` (the math) | Built | An independent Python reference with a differential runner, golden vectors, property tests, exhaustive checks, 15 Kani harnesses, mutation testing (`docs/09-VERIFICATION.md`) | | Programs: Floor, Vault, and Harbor (a demo protocol) | Built for sBPF v3 | LiteSVM on the real agave runtime and loader (scenarios, negative tests, compute), a program-vs-model differential, and an end-to-end run on a local validator | | Bulkhead Cloud (guardian bot, status page, client) | Built | Unit tests, a JavaScript-vs-Python differential, the end-to-end run | -| Devnet deployment | Deployed 28 Sep 2026; upgraded in place 29 Sep, 6 Oct, 7 Oct, twice on 8 Oct, six times on 9 Oct, once on 10 Oct and once on 11 Oct (below) | All three programs run the canonical build (Linux x86_64; CI publishes it) of PR #77 (the Vault unchanged since PR #75, Harbor since 6 Oct), matched byte for byte with the upgrade authority checked | +| Devnet deployment | Deployed 28 Sep 2026; upgraded in place 29 Sep, 6 Oct, 7 Oct, twice on 8 Oct, six times on 9 Oct, once on 10 Oct, once on 11 Oct and once on 15 Oct (below) | All three programs run the canonical build (Linux x86_64; CI publishes it) of `main` at PR #85 (Harbor unchanged since 6 Oct), matched byte for byte with the upgrade authority checked | None of this is an audit. The mainnet path: 1. two independent audits (a Solana specialist, and a formal-methods review of the core); @@ -26,11 +26,11 @@ Devnet only; test tokens only. The upgrade authority of all three programs is a | Program | Devnet id | sha256 of the deployed code (Agave v4.3.0, platform-tools v1.57, sBPF v3) | |---|---|---| -| Floor | `HARLZqMwqocBnbhbSTWkd5i8EHmjHXLHr1T9su3SR31E` | `257996d091175f487fc4eea72239ec0da0ae5fc20188786c2249e6763d5b6a6a` (upgraded in place 11 Oct, PR #77: a release to none needs the owner's signature, `09` finding 95; earlier on 10 Oct `cb0992a710f56beb1d847044dbac5aa856a34eeedb15b19ee7678b147ce92d31`, PR #75: a release closes any further frozen buffer it is passed, `09` finding 93; earlier on 9 Oct `505688c7d2be2330c761a343f33691fb8057fdc26d182093a1ece0a2e98b12b0`, PR #61: a snapshot at least the live ELF's declared length, a quorum may replace the abort binary, the stop's spill is the config, `09` finding 88; earlier on 9 Oct `58159d04deaa89b3476eed9143765cb704c6f0e72e9ba3b844912aa607bd9cbe`, PR #57: `close_buffer` never closes a buffer identical to the live code while the program runs, `09` finding 85; earlier on 9 Oct `e06a86e79fae1246b5fd7432cf59b535c75312337fdefae2b3962f8e43a0b9c9`, PR #52, after extending its program data by 10,240 bytes: `close_buffer` returns orphaned buffers' rent, a release closes the abort buffer and the pin and needs the new authority's signature, `09` findings 78 and 80; earlier on 8 Oct `ff8bda423405722fede5786083be0e67a42128e98193ad743681df711c64dfde`, PR #35: a stop accepts any snapshot identical to the live code, finding 66; no key both guardian and recovery key; a delay raise passes a recovery proposal; a cut-off recovery key is refused, findings 63 and 70; earlier on 8 Oct `913b2eca965e7fb8b5ef50a8ff9b137422fb7fc4a20e713e54af689dafa0c05b`: `replace_recovery`, a dead recovery proposal frees the slot, no key both guardian and recovery key, `09` finding 62; 7 Oct to 8 Oct `ef013d0109c6a8dba26489b36872e24b38f2fc039e0d49a5ec819efc2df45e01`, the first version of that change; until then `d04e4b555a3b6ef7f7cb945db66323f92965e20fff00adbab2c9b3f675d115bc`, after it was upgraded in place 7 Oct twice: to `3639b131071f92a54e4649bc11c01fe2729309d040f783ceb1fa66d6ad051dfa`, a stop must name the pinned snapshot, `09` finding 53; then to this, findings 57 and 58; 6 Oct to 7 Oct `844f46784b5831bea63b7d775dc43ad28a9044a588416f0ae9f002eca901f623`; until then `ef2b349b77473643e942afe23e190e7a3ae0e9eda2636d78c58c3b719c324dba`) | -| Vault | `HK5FbaLtvNSPHj9HYbuStfVxXktkoMejJ9GEjn8WCY1b` | `b0cda14c30613d3c9ca9d8c3b7f930bb9d809c25193386e60b7cfbad0af96097` (upgraded in place 10 Oct, PR #75: a lifeboat exit executes only while its proposer is still the admin, abdications bind `upsert_asset` and `create_vault` before the seal, `09` findings 91 and 92; earlier on 9 Oct `69f2d6a1ad451f1fa6adfcce42ca0907d95278684fb1d2c29568ab95cf4127e9`, PR #63: a freeze stops new loans, own deposits still leave, `09` finding 90; earlier on 9 Oct `e1493007c3e24d045c9681f5d058d01452682ca7d851169e96b093b25df23562`, PR #61: the lifeboat opens a loosen delay after the seal, the recovery key ends a seal review, abdicated tightenings need a quorum, bounded oracle settings, a replaced admin's queue never executes, at most 10 vaults before the seal, `09` findings 87–89; earlier on 9 Oct `9ec83cc928ccdfcb063615940c211e39ccc2cab33d6d76325e6d16328abacdd8`, PR #59: the lifeboat opens with the seal, `09` finding 86; earlier on 9 Oct `8cf8d1633345f78b60bc0132a903e595206588a35f46fcdd48a9d64812a33f24`, PR #57: the lifeboat exit's destination signs, `09` finding 85; earlier on 9 Oct `ecf2c2260ffda4902d4fd387dcf6489ff681e8fc330aa7d869ffc02e8555c177`, PR #52: a lifeboat exit never pays an account this program owns, `09` finding 79; earlier on 9 Oct `cb1971efcfaee5b815b091cc68fa21fa20fe9a66049a11df4fbb42b4ba2a4b97`, PR #49: a backed loan needs the borrower's signature, finding 74; settle reports a short vault and the reference clock never steps back, 75; earlier on 8 Oct `b53ce331aef9bfc6bf746002390f9df74968972a11f18e3d261ad307a8ec033b`, PR #35, after extending its program data by 10,240 bytes: the low-water base, finding 65; events name their protocol, 64; ticket ids, 67; rescaling mints never priced, 68; lifeboat, seal and admin edges, 72; and findings 63 and 70; earlier on 8 Oct `067434af00cc949e17e3d8a6dae397fae9be6a7594dd7d47ee5d614e94877382`: `replace_recovery`, which obeys the seal review and abdication, and no key both guardian and recovery key, `09` finding 62; 7 Oct to 8 Oct `3173b14ab6856e76c499f2104c781a6d058a00e1ee803be8da0260f3e5ed659b`, the first version of that change; until then `aba7e697fa1fb6bb171c657bd913e6c8062bd1889df477851864e7b15e3d67c3`, after it was upgraded in place 7 Oct: delisted collateral stays locked while its loan is open, `09` finding 56, critical, and finding 57; 6 Oct to 7 Oct `c73b058de016ff05adf8b7a36d97beac47d3f970f429af1be0dff34bc3b2cdae`, after it was upgraded in place 6 Oct three times: to `e1961181e062cc6641da9940354cab7cea8f22809d89fe76b97708d26ff2592c`; to `b8a2fbf89cac8012e141e9262fc4fe539e501c260aac000630b37411658921c5`, whose token-account and mint readers are split into pure functions so the fuzzers test the code the program runs; then to this, the same source built on Linux x86_64, the canonical build host (`09`, finding 43); 29 Sep to 6 Oct `79b0a47ff3086fe2389e5ac089560f530a7d4089fcd5d12814a30132a62d9c93`; until 29 Sep `466cc17beb71ebb1f342cec5bc6ac10c333b58e7d537d675fd57bc3a6eca22eb`) | +| Floor | `HARLZqMwqocBnbhbSTWkd5i8EHmjHXLHr1T9su3SR31E` | `508e5a99fd2bc99573ecea08c64e7f2c45a472108ece34a58d78a7cac406c16b` (upgraded in place 15 Oct, to `main` at PR #85 (`3eec968`): a guardian set needs a quorum below its size, `09` finding 96; a release accepts a frozen live copy in place of the pin, finding 99; the guardian set shared through the core, finding 103; Floor split into modules, compute unchanged; earlier on 11 Oct `257996d091175f487fc4eea72239ec0da0ae5fc20188786c2249e6763d5b6a6a`, PR #77: a release to none needs the owner's signature, `09` finding 95; earlier on 10 Oct `cb0992a710f56beb1d847044dbac5aa856a34eeedb15b19ee7678b147ce92d31`, PR #75: a release closes any further frozen buffer it is passed, `09` finding 93; earlier on 9 Oct `505688c7d2be2330c761a343f33691fb8057fdc26d182093a1ece0a2e98b12b0`, PR #61: a snapshot at least the live ELF's declared length, a quorum may replace the abort binary, the stop's spill is the config, `09` finding 88; earlier on 9 Oct `58159d04deaa89b3476eed9143765cb704c6f0e72e9ba3b844912aa607bd9cbe`, PR #57: `close_buffer` never closes a buffer identical to the live code while the program runs, `09` finding 85; earlier on 9 Oct `e06a86e79fae1246b5fd7432cf59b535c75312337fdefae2b3962f8e43a0b9c9`, PR #52, after extending its program data by 10,240 bytes: `close_buffer` returns orphaned buffers' rent, a release closes the abort buffer and the pin and needs the new authority's signature, `09` findings 78 and 80; earlier on 8 Oct `ff8bda423405722fede5786083be0e67a42128e98193ad743681df711c64dfde`, PR #35: a stop accepts any snapshot identical to the live code, finding 66; no key both guardian and recovery key; a delay raise passes a recovery proposal; a cut-off recovery key is refused, findings 63 and 70; earlier on 8 Oct `913b2eca965e7fb8b5ef50a8ff9b137422fb7fc4a20e713e54af689dafa0c05b`: `replace_recovery`, a dead recovery proposal frees the slot, no key both guardian and recovery key, `09` finding 62; 7 Oct to 8 Oct `ef013d0109c6a8dba26489b36872e24b38f2fc039e0d49a5ec819efc2df45e01`, the first version of that change; until then `d04e4b555a3b6ef7f7cb945db66323f92965e20fff00adbab2c9b3f675d115bc`, after it was upgraded in place 7 Oct twice: to `3639b131071f92a54e4649bc11c01fe2729309d040f783ceb1fa66d6ad051dfa`, a stop must name the pinned snapshot, `09` finding 53; then to this, findings 57 and 58; 6 Oct to 7 Oct `844f46784b5831bea63b7d775dc43ad28a9044a588416f0ae9f002eca901f623`; until then `ef2b349b77473643e942afe23e190e7a3ae0e9eda2636d78c58c3b719c324dba`) | +| Vault | `HK5FbaLtvNSPHj9HYbuStfVxXktkoMejJ9GEjn8WCY1b` | `d2994425850d8bc78b60000454366dcd5c18c5a69960f8a2f23bacce8665544d` (upgraded in place 15 Oct, to `main` at PR #85 (`3eec968`): a guardian set needs a quorum below its size, `09` finding 96; the lifeboat refuses fee-bearing mints, finding 97; the caller PDA's signature is never a borrower's consent, finding 98; a reset never grants more than an empty bucket, finding 101; the guardian set shared through the core, finding 103; earlier on 10 Oct `b0cda14c30613d3c9ca9d8c3b7f930bb9d809c25193386e60b7cfbad0af96097`, PR #75: a lifeboat exit executes only while its proposer is still the admin, abdications bind `upsert_asset` and `create_vault` before the seal, `09` findings 91 and 92; earlier on 9 Oct `69f2d6a1ad451f1fa6adfcce42ca0907d95278684fb1d2c29568ab95cf4127e9`, PR #63: a freeze stops new loans, own deposits still leave, `09` finding 90; earlier on 9 Oct `e1493007c3e24d045c9681f5d058d01452682ca7d851169e96b093b25df23562`, PR #61: the lifeboat opens a loosen delay after the seal, the recovery key ends a seal review, abdicated tightenings need a quorum, bounded oracle settings, a replaced admin's queue never executes, at most 10 vaults before the seal, `09` findings 87–89; earlier on 9 Oct `9ec83cc928ccdfcb063615940c211e39ccc2cab33d6d76325e6d16328abacdd8`, PR #59: the lifeboat opens with the seal, `09` finding 86; earlier on 9 Oct `8cf8d1633345f78b60bc0132a903e595206588a35f46fcdd48a9d64812a33f24`, PR #57: the lifeboat exit's destination signs, `09` finding 85; earlier on 9 Oct `ecf2c2260ffda4902d4fd387dcf6489ff681e8fc330aa7d869ffc02e8555c177`, PR #52: a lifeboat exit never pays an account this program owns, `09` finding 79; earlier on 9 Oct `cb1971efcfaee5b815b091cc68fa21fa20fe9a66049a11df4fbb42b4ba2a4b97`, PR #49: a backed loan needs the borrower's signature, finding 74; settle reports a short vault and the reference clock never steps back, 75; earlier on 8 Oct `b53ce331aef9bfc6bf746002390f9df74968972a11f18e3d261ad307a8ec033b`, PR #35, after extending its program data by 10,240 bytes: the low-water base, finding 65; events name their protocol, 64; ticket ids, 67; rescaling mints never priced, 68; lifeboat, seal and admin edges, 72; and findings 63 and 70; earlier on 8 Oct `067434af00cc949e17e3d8a6dae397fae9be6a7594dd7d47ee5d614e94877382`: `replace_recovery`, which obeys the seal review and abdication, and no key both guardian and recovery key, `09` finding 62; 7 Oct to 8 Oct `3173b14ab6856e76c499f2104c781a6d058a00e1ee803be8da0260f3e5ed659b`, the first version of that change; until then `aba7e697fa1fb6bb171c657bd913e6c8062bd1889df477851864e7b15e3d67c3`, after it was upgraded in place 7 Oct: delisted collateral stays locked while its loan is open, `09` finding 56, critical, and finding 57; 6 Oct to 7 Oct `c73b058de016ff05adf8b7a36d97beac47d3f970f429af1be0dff34bc3b2cdae`, after it was upgraded in place 6 Oct three times: to `e1961181e062cc6641da9940354cab7cea8f22809d89fe76b97708d26ff2592c`; to `b8a2fbf89cac8012e141e9262fc4fe539e501c260aac000630b37411658921c5`, whose token-account and mint readers are split into pure functions so the fuzzers test the code the program runs; then to this, the same source built on Linux x86_64, the canonical build host (`09`, finding 43); 29 Sep to 6 Oct `79b0a47ff3086fe2389e5ac089560f530a7d4089fcd5d12814a30132a62d9c93`; until 29 Sep `466cc17beb71ebb1f342cec5bc6ac10c333b58e7d537d675fd57bc3a6eca22eb`) | | Harbor (demo) | `6w9t76W2w8q38xTvUPuDDzSwrjTKbq4dM8nAckYXScYh` | `543be60b25b557ea0a58f0c4d2133f67954172006d2a21490217cb4010adeb40` (upgraded in place 6 Oct; until then `d91a8ac28a3d2bffe07de80f20028a09a1f15c8e7639e5551250c9b54cb712f2`) | -`loader.mjs verify` matched all three byte for byte on 11 Oct, against CI's binaries of PR #77 (Floor upgraded to it that day; the Vault the same bytes since PR #75, Harbor since 6 Oct), with the team key required as the upgrade authority. Release binaries are Linux x86_64 builds: CI's (each pull request's `programs` artifact, with `SHA256SUMS`), or `scripts/build-programs-docker.sh` on any machine with Docker. A build on macOS has the same instructions in another order, so its Vault hash differs. +`loader.mjs verify` matched all three byte for byte on 15 Oct, against CI's binaries of PR #85, whose tree is `main`'s `3eec968` (Floor and Vault upgraded to it that day; Harbor the same bytes since 6 Oct), with the team key required as the upgrade authority. Release binaries are Linux x86_64 builds: CI's (each pull request's `programs` artifact, with `SHA256SUMS`), or `scripts/build-programs-docker.sh` on any machine with Docker. A build on macOS has the same instructions in another order, so its Vault hash differs. The demo market's admin and guardian keys are also team-held. On devnet that is the point: S1 plays the attacker with the admin key. diff --git a/docs/05-PROGRAM-SPEC.md b/docs/05-PROGRAM-SPEC.md index 0779fd4..00baf77 100644 --- a/docs/05-PROGRAM-SPEC.md +++ b/docs/05-PROGRAM-SPEC.md @@ -6,7 +6,7 @@ This is the contract between the program, its integrators, the tests and auditor - moves tokens; - emits events. -Status: built (Pinocchio 0.11, one dependency: `bulkhead-core`), sBPF v3. Tested with scenario and negative tests plus a program-vs-model differential on the real runtime (`09 §7`), and exercised end-to-end on `solana-test-validator` (`cloud/e2e`). Deployed on devnet on 28 Sep 2026 (`HK5FbaLtvNSPHj9HYbuStfVxXktkoMejJ9GEjn8WCY1b`); devnet runs this tree's build (the same Vault bytes since PR #75, 10 Oct; `08`, `SECURITY.md`). Unaudited. +Status: built (Pinocchio 0.11, one dependency: `bulkhead-core`), sBPF v3. Tested with scenario and negative tests plus a program-vs-model differential on the real runtime (`09 §7`), and exercised end-to-end on `solana-test-validator` (`cloud/e2e`). Deployed on devnet on 28 Sep 2026 (`HK5FbaLtvNSPHj9HYbuStfVxXktkoMejJ9GEjn8WCY1b`); devnet runs this tree's build (PR #85, 15 Oct; `08`, `SECURITY.md`). Unaudited. Conventions: - `now` = `Clock::unix_timestamp` (seconds); limiter math uses `now_ms = now × 1000`. diff --git a/docs/06-FLOOR.md b/docs/06-FLOOR.md index 9bbc3ee..c87f659 100644 --- a/docs/06-FLOOR.md +++ b/docs/06-FLOOR.md @@ -10,7 +10,7 @@ Floor is a small program (`programs/floor`, Pinocchio, one dependency: `bulkhead It is a separate program from the Vault so each has a small audit surface and its own blast radius. -Status: built, tests on the real agave loader (LiteSVM with the mainnet feature set), sBPF v3 (`e_flags = 3`). Deployed on devnet on 28 Sep 2026 (`HARLZqMwqocBnbhbSTWkd5i8EHmjHXLHr1T9su3SR31E`). Devnet runs this tree's build (PR #77, 11 Oct; `SECURITY.md`). The full lifecycle has run there (§7). Unaudited. +Status: built, tests on the real agave loader (LiteSVM with the mainnet feature set), sBPF v3 (`e_flags = 3`). Deployed on devnet on 28 Sep 2026 (`HARLZqMwqocBnbhbSTWkd5i8EHmjHXLHr1T9su3SR31E`). Devnet runs this tree's build (PR #85, 15 Oct; `SECURITY.md`). The full lifecycle has run there (§7). Unaudited. ## 1. Why it exists diff --git a/docs/08-SCENARIOS.md b/docs/08-SCENARIOS.md index ca04b1f..ed2a35e 100644 --- a/docs/08-SCENARIOS.md +++ b/docs/08-SCENARIOS.md @@ -141,7 +141,7 @@ Not done: the same run on the programs (LiteSVM), and a replay of a real crash d ## Devnet signatures -Deployed 28 Sep 2026; the Vault upgraded in place on 29 Sep; all three upgraded in place on 6 Oct (#8, #12, #16); Floor and Vault twice on 8 Oct, to the PR #35 build (findings 63–73); the Vault again on 9 Oct, to PR #49 (findings 74–75), then Floor and Vault to PR #52 (findings 78–80) to PR #57 (finding 85), the Vault to PR #59 (finding 86), Floor and Vault to PR #61 (findings 87–89), the Vault to PR #63 (finding 90), Floor and Vault on 10 Oct to PR #75 (findings 91–93), and Floor on 11 Oct to PR #77 (finding 95). Every transaction below is finalized and succeeded. Program ids, hashes and the upgrade authority are in `SECURITY.md`. +Deployed 28 Sep 2026; the Vault upgraded in place on 29 Sep; all three upgraded in place on 6 Oct (#8, #12, #16); Floor and Vault twice on 8 Oct, to the PR #35 build (findings 63–73); the Vault again on 9 Oct, to PR #49 (findings 74–75), then Floor and Vault to PR #52 (findings 78–80) to PR #57 (finding 85), the Vault to PR #59 (finding 86), Floor and Vault to PR #61 (findings 87–89), the Vault to PR #63 (finding 90), Floor and Vault on 10 Oct to PR #75 (findings 91–93), Floor on 11 Oct to PR #77 (finding 95), and Floor and Vault on 15 Oct to PR #85 (findings 96–99, 101 and 103). Every transaction below is finalized and succeeded. Program ids, hashes and the upgrade authority are in `SECURITY.md`. **Programs** @@ -154,8 +154,8 @@ Deployed 28 Sep 2026; the Vault upgraded in place on 29 Sep; all three upgraded | Vault upgraded in place, 6 Oct (A7–A13, findings 30–39): `e1961181…`, verified byte-identical; the existing market reads unchanged | [`57uVm7WA…`](https://explorer.solana.com/tx/57uVm7WA3p7wHkHSDKaLgYDMdLLKemVRcLR55weXtc2F2T1t5QE5LdXySNov2mLNj13iVMGwfhHzNfkLQWkmLcu4?cluster=devnet) | | Vault upgraded in place again, 6 Oct (the token readers made pure for fuzzing, `09` §2): `b8a2fbf8…`, verified byte-identical; the market and both pending changes read unchanged | [`tjCrUmzz…`](https://explorer.solana.com/tx/tjCrUmzzPrbnezNtosgRxNL5mSH7BNeUeKngqNy562dkC9pmstWHZpXg442hN78W6fhNrojTdUFNit3eJLmyPyX?cluster=devnet) | | Vault upgraded in place a third time, 6 Oct: the same source as `b8a2fbf8…`, now the canonical Linux x86_64 build `c73b058d…` (CI's binary, after its LiteSVM and end-to-end runs; `09`, finding 43), verified byte-identical | [`27WnYt2b…`](https://explorer.solana.com/tx/27WnYt2bkuur5QSE3nwyrmijHNdMnaV9w41PwfijDS5e6B3ucKJG8i9ctnduYd8hyHkCZycsA16zae8GuuSbRHQH?cluster=devnet) | -| Floor upgraded in place, 6 Oct: `844f4678…`, verified byte-identical | -| Floor upgraded in place again, 7 Oct: a stop must name the pinned snapshot (`09`, finding 53). CI's build `3639b131…`, after its LiteSVM tests, the account sweep and a 200,000-step differential; verified byte-identical | [`CBidpJQa…`](https://explorer.solana.com/tx/CBidpJQaxuBmdSY5xYVgnDUjg6xyGD6bbuaHRfEe3FtHcvGwGoekEJBeXG5fdrMN1u8psMrHzHAzFWGnqEYhmmJ?cluster=devnet) | [`rYB7M4Er…`](https://explorer.solana.com/tx/rYB7M4ErEBTA2yKFGi3Dr4XKt72ChZhSUxpriGjZAoAwnAFv1ss5FBKf2HphqoeyQPwEozXxDsxxHNa5ovaG3HM?cluster=devnet) | +| Floor upgraded in place, 6 Oct: `844f4678…`, verified byte-identical | [`rYB7M4Er…`](https://explorer.solana.com/tx/rYB7M4ErEBTA2yKFGi3Dr4XKt72ChZhSUxpriGjZAoAwnAFv1ss5FBKf2HphqoeyQPwEozXxDsxxHNa5ovaG3HM?cluster=devnet) | +| Floor upgraded in place again, 7 Oct: a stop must name the pinned snapshot (`09`, finding 53). CI's build `3639b131…`, after its LiteSVM tests, the account sweep and a 200,000-step differential; verified byte-identical | [`CBidpJQa…`](https://explorer.solana.com/tx/CBidpJQaxuBmdSY5xYVgnDUjg6xyGD6bbuaHRfEe3FtHcvGwGoekEJBeXG5fdrMN1u8psMrHzHAzFWGnqEYhmmJ?cluster=devnet) | | Vault upgraded in place, 7 Oct: delisted collateral stays locked while its loan is open (`09`, finding 56, critical) and a guardian never becomes the admin (57). CI's build `aba7e697…`, after its LiteSVM tests, the account sweep, the end-to-end run and the deploy rehearsal; verified byte-identical; the market reads unchanged | [`2RduYXgh…`](https://explorer.solana.com/tx/2RduYXghwDFKHhLYvJEABoJNCxPLpxj1XkFZ4RTwt3shUQnXvVDL4wFo4s1g89YZa3x19iqqvYDinYnHbd5TJMx1?cluster=devnet) | | Floor upgraded in place, 7 Oct: approvals name their proposal, the abort buffer and snapshot are never an upgrade, buffer rent returns to the owner (58), the owner is never a guardian (57). CI's build `d04e4b55…`; verified byte-identical | [`338Xk79P…`](https://explorer.solana.com/tx/338Xk79PpprQ3KgnNvNbhiaEnNibvrkvzMiZFNFfA3E9WP3rqigBdgpTA8qZgMB2Ukrr3ssWWW3DvCuCDmky9RcV?cluster=devnet) | | Floor and Vault upgraded in place, 7 Oct, to the first version of finding 62 (`09`): `ef013d01…` and `3173b14a…`, CI's builds | [`2xzPLuoW…`](https://explorer.solana.com/tx/2xzPLuoWVRkLbqo7iQvWRCHGWR7hGLjBDV8ZuDo4bhfMzLgHAhKWjBJjGet512LPFvBCKg1tAxMdLm82N1DVtvkc?cluster=devnet), [`5LZCj796…`](https://explorer.solana.com/tx/5LZCj796zmw5mU7N1ANFjXmAkqYb57fTWBwhbTEMc53FJWQBw8217EQtveEmJTB4uswLFsW7CDESKhrYNg3ooouq?cluster=devnet) | @@ -176,6 +176,7 @@ Deployed 28 Sep 2026; the Vault upgraded in place on 29 Sep; all three upgraded | Floor upgraded in place, 10 Oct, to PR #75 (`09`, finding 93: a release closes any further frozen buffer it is passed). CI's build `cb0992a7…`; verified byte-identical with the authority checked; programdata large enough, no extension. S10's config reads unchanged: `floor-buffers.mjs` finds its abort buffer and pin, and no orphans | [`518c4LW3…`](https://explorer.solana.com/tx/518c4LW3kkmtf1qKpSd5Uqmx6jRBaBm7DSnQyydrtr2Kyb32f7EbtDdZzoSDE3AoUo1EjFPRf4RjnzgvK3pNKPNt?cluster=devnet) | | Vault upgraded in place, 10 Oct, to PR #75 (`09`, findings 91 and 92: a lifeboat exit executes only while its proposer is still the admin; abdications bind `upsert_asset` and `create_vault` before the seal). CI's build `b0cda14c…`; verified byte-identical with the authority checked; `vault-check` passes in full. No exit was pending (the lifeboat is empty), so nothing had to be proposed again; Harbor was already identical to that build, and no buffers are left | [`5LfX3zy7…`](https://explorer.solana.com/tx/5LfX3zy7VV1qExVxAYnJWG5oFp2MPh9uo1KiK1rmY9V4KRu2wDTnJAtH3CwhEmpJygrVnh6NxXbUHQj9qXfoeh7g?cluster=devnet) | | Floor upgraded in place, 11 Oct, to PR #77 (`09`, finding 95: a release to none needs the owner's signature). CI's build `257996d0…`; verified byte-identical with the authority checked, the Vault and Harbor unchanged; programdata large enough, no extension. S10's config reads unchanged: `floor-buffers.mjs` finds its abort buffer and pin, and no orphans; `vault-check` passes | [`22axxNhG…`](https://explorer.solana.com/tx/22axxNhGQYPTzpV67YFVfthdY92N8QcsrNSznRnTs6Hq7VSDgaYUJALE7XnFpHxcu6aBjUsvn9jMbLhpGnrqpBXV?cluster=devnet) | +| Floor and Vault upgraded in place, 15 Oct, to PR #85, `main` at `3eec968` (`09`, findings 96–99, 101 and 103; Floor split into modules). CI's builds `508e5a99…` and `d2994425…`; verified byte-identical with the authority checked, Harbor unchanged; programdata large enough, no extension, no buffers left. Both live guardian sets (the market's and S10's: 3 keys, quorum 2) meet finding 96's rule; S10's config reads unchanged: `floor-buffers.mjs` finds its abort buffer and pin, and no orphans; a simulated S10 guardian heartbeat succeeds; `vault-check` passes | Floor [`2JPsyb5m…`](https://explorer.solana.com/tx/2JPsyb5mWtwC6sbVcaBBXrqRMNGSn6pTJe7DvqTMNDfCTYc1s7t4cnsV495oqpF8LUWkf15yFAFy18CpkqX6CCAp?cluster=devnet), Vault [`2xjx6psd…`](https://explorer.solana.com/tx/2xjx6psdtoVAqepn2xCgtMJn71eYvH6y9zyzqgjnxXuUhhQdjWCsiZUBd7hsxbx7tB5t3qTDzC6K361s7WA9HvpA?cluster=devnet) | | Harbor upgraded in place, 6 Oct (built-in Vault id, A11): `543be60b…`, verified byte-identical | [`ZkpJvwHA…`](https://explorer.solana.com/tx/ZkpJvwHARZ7EpjSdNnYvP8EaEgcyeF8HMKMXC3gSSWpCMH1fGpz89swWac4so9FBfnJi7KUa1jqSkxHNxSSJFqL?cluster=devnet) | | Guardians 1 and 2 had gone stale (last heartbeat 27 Sep). The admin proposed the same guardian set again (change 0, executable from 9 Oct 06:17 UTC; anyone executes it with `market.mjs execute-change`) | [`5vkjPJKP…`](https://explorer.solana.com/tx/5vkjPJKP5UUM2F5ektPRfQtANLtXTFcEujdMdfo9Z4cfYhjuy44ws5ga7a3W55qQXcM42xZiMx32A167Bddz3iT7?cluster=devnet) | | The admin proposed a recovery key for the market (change 1, executable from 9 Oct 06:17 UTC; `09 §4`, finding 38). Until both execute, run S1 on devnet with `APPROVED_CHANGES` set to the two approvals `node cloud/deploy/approvals.mjs` prints for them (comma-separated), or its guardian vetoes them. `node cloud/deploy/finish-renewals.mjs ` executes all three once due (safe to run any time; it skips what is done and reports what is not yet due) | [`3TGZtTtk…`](https://explorer.solana.com/tx/3TGZtTtkMKyQVzf2heEEnXFs1exrvshWqnkqRz3ne6q1gu9Xq7gN4pkSjp3HqnTpqRLKLafWWG2frzbSM1xNh8Ee?cluster=devnet) | diff --git a/docs/09-VERIFICATION.md b/docs/09-VERIFICATION.md index a3e6d35..ab8528f 100644 --- a/docs/09-VERIFICATION.md +++ b/docs/09-VERIFICATION.md @@ -199,14 +199,14 @@ cloud/e2e/s1.sh # S1 with the guardian on any | 93 | 10 Oct | Reported by a contributor (issue #68), confirmed in the code | **A release left a spare pin locked for good.** `pin_snapshot` is open to anyone, and while the program is live `close_buffer` refuses any buffer identical to the live code (finding 85). So a pin replaced by an identical copy is a spare nobody can close until the code changes or a stop, and a release, which closes the config, ends both: the spare's rent (~1.04 SOL per 200 KB) stayed locked. Finding 85 accepted spare-pin griefing because the spare could be closed later; after a release it could not. | Fixed (on-chain, Floor; PR #71; on devnet since 10 Oct, PR #75). After the abort buffer and the pin, a release closes every further account it is passed that `check_frozen_buffer` accepts (a loader-v3 buffer whose authority is Floor's PDA), rent to the owner; duplicates, the new authority and anything else are skipped, and only a buffer tag passes, so the program and its data account never close. Optional, so a buffer frozen at the last moment cannot block a release. `floor-buffers.mjs` says a release closes spares passed to it. Test: a spare refused by `close_buffer` while live, then closed by the release (passed twice), and the owner receives every rent (fails without the change). | | 94 | 10 Oct | A contributor, deleting checks one at a time (PRs #72, #73, #74) | **Three rules no test could fail, and two stale sentences.** (a) Finding 74's test made its unsigned payout after a freeze; since finding 90 a freeze caps the backed amount at the owner's balance anyway, so with the signature rule in `release` deleted every program test still passed. (b) Finding 75's two edges had no program test: deleting the `InsufficientBalance` check in `settle_ticket` (the token program refuses a short transfer anyway) or the guard that keeps the reference timestamp from moving back (every test clock only moves forward) passed everything. (c) `06` and `04` said `elf_is_v3` is set at every install; a stop leaves it, so it still describes the stopped code a restore brings back. The guardian's header called `startupMaxSignatures` the replay's bound; it is checked between pages of 1,000. | Tests added and docs corrected (PRs #72–#74). The unsigned payout runs before the freeze, where only the signature rule can refuse the loan, and the frozen one stays as finding 90's case; a ticket settled from a vault the whale emptied (G2) fails with 8049; a clock stepped back 600 s leaves `ref_updated_s` where it was. Each new test was checked to fail with its rule deleted (the five Vault rules together: 73 others still pass, so nothing else guarded them). | | 95 | 10 Oct | Review of findings 87–94 before the submission (an AI-agent review, each claim reproduced on LiteSVM) | **A stranger could still strand a spare.** Finding 93 made the spares a release closes optional, so a buffer frozen at the last moment cannot block it. But a release to none (the program becomes immutable) needed no signature at all: anyone could execute it once due and pass only the abort buffer and the pin, and every spare the owner meant to close was locked for good, finding 93's loss by a third party. A release to a key was not affected: that key signs. The same review found nothing else in 87–94; the hypotheses it ruled out are in the PR. | Fixed (on-chain, Floor; on devnet since 11 Oct, PR #77). A release to none needs the owner's signature (`MissingSignature`), so only the owner executes it and chooses the spares. Test `a_release_to_none_needs_the_owner_so_no_stranger_strands_a_spare`: unsigned refused with the config intact, signed closes the spare and returns every rent (fails with the check removed), and the account-substitution sweep now runs a release to none, where the owner unsigned is refused (the sweep fails with the check removed). A release to a key is executed by that key, so its holder, whom the owner named, chooses which spares it closes. | -| 96 | 13 Oct | Review of Floor after the submission (an AI-agent review, each claim checked against the code) | **An n-of-n guardian set lets one rogue guardian keep a program stopped for good.** Floor's `parse_guardian_set` (and the Vault's) accepts `threshold == count` (2-of-2, 3-of-3), and `can_eject` needs `count > threshold`, so nobody in such a set can be ejected. In a 2-of-2 set, the rogue stops the program; a restore needs a quorum, which needs the rogue; it vetoes the owner's RESTORE, and every new SetGuardians or ReleaseAuthority, as each is proposed. The recovery key rotates only the owner. This is AUD-2 (`16`) without the lost key: one key alone, where G5 says a live quorum of the others ejects a rogue. In the Vault the same set lets one rogue guardian renew freezes and veto every loosening indefinitely; own deposits still leave (G2). | Fixed (on-chain, Floor and Vault; not yet on devnet). Both `parse_guardian_set`s call the core's `guardian_set_ok`: `2 ≤ threshold < count ≤ 8`, so a set has at least 3 keys. Kani `accepted_sets_can_eject_anyone` proves an accepted set is exactly one where every guardian can be ejected by the others; the differential gained `GV` (Rust = Python). Tests: `registration_rejects_weak_settings` (Floor, 2-of-2 and 3-of-3), `an_n_of_n_guardian_set_is_refused` (Vault); both fail on the previous build. The guardian still warns below `threshold + 2`. | -| 97 | 13 Oct | Review of the Vault after the submission (as 96) | **A stolen admin key can burn value on a fee-bearing mint by cycling the lifeboat.** `TransferFeeConfig` mints are allowed (`05` §7), and Token-2022 withholds the fee on every `transfer_checked`, even between two accounts the vault PDA owns. After the seal, `lifeboat_move` (admin, instant while not frozen) and `lifeboat_return` (the admin alone) can be paired many times in one transaction, before any guardian can act: at 1%, about 30 round trips withhold about 45% of the vault as fees. The attacker gains nothing (withheld fees go to the mint's withdraw authority), but depositors lose it, and no guarantee covers it: it is not unbacked outflow (G1) and not an exit (G6). The fee's per-transfer maximum caps the loss. | Fixed (on-chain, Vault; not yet on devnet). `lifeboat_move` refuses a mint whose TransferFeeConfig has a fee config authority or a non-zero older or newer fee (`FeeBearingMint`, 8055); `lifeboat_return` is unchanged, so funds always come back. Test: `the_lifeboat_refuses_a_mint_that_charges_or_can_charge_a_transfer_fee` (fails on the previous build). | -| 98 | 13 Oct | The same review | **The caller PDA's own signature counts as a borrower's consent.** `release` refuses a recipient owned by the vault or protocol PDA, but not by the caller PDA, and the caller signs every release. An integrator that deposits through its caller PDA as the authority (a pooled design) therefore has its ledger's loans consented automatically: a compromised protocol program (T2) borrows other mints through the backed lane, up to the haircut value, with no user signature, which finding 74 meant to rule out. A freeze still caps it at the owner's own balance (finding 90). Harbor's flow, where the user is the deposit authority, is unaffected. Also found, informational: a change's payload accepts trailing bytes that no rule reads (a review UI could show them as meaningful), and a mint's freeze authority can set DefaultAccountState to Frozen after `create_vault`, so a lifeboat created later is born frozen (covered by trusting the issuer, `07` §2). | Fixed (on-chain, Vault; not yet on devnet). In `release`, when the recipient's owner is the caller PDA its signature is never consent: the backed amount is capped at the ledger's own balance of the mint (G2 unchanged: that balance still leaves instantly). Refusing such a recipient outright, as first proposed, would have stopped a pooled integrator's own-deposit withdrawals. Test: `the_callers_own_signature_is_not_consent_to_a_loan` (on the previous build, 50,000 USDC was paid as a backed loan with no user signature). The trailing-payload note stays informational. | -| 99 | 14 Oct | Adversarial audit of Floor (an AI-agent review with a LiteSVM PoC, against agave's loader 4.2.2) | **A stranger could make a release fail, round after round.** `pin_snapshot` is open to anyone while the program is live, and `ReleaseAuthority` refused unless it named whatever was pinned when it executed. A stranger who landed `pin_snapshot` with its own frozen copy of the live code just ahead of the owner's release made it fail (`WrongBuffer`), and could repeat this until the proposal expired; the owner then waited the delay again. The race finding 66 closed for `abort`, open on the release path. Low: delay only, one buffer's rent per round. | Fixed (on-chain, Floor; not yet on devnet). While the program is live, a passed frozen buffer byte-identical to the live code stands in for the pin, as in `abort`, and is closed to the owner with the spares; the stranger's copy keeps the stranger's rent. Test: `a_strangers_re_pin_cannot_make_a_release_fail` (fails on the previous build). | +| 96 | 13 Oct | Review of Floor after the submission (an AI-agent review, each claim checked against the code) | **An n-of-n guardian set lets one rogue guardian keep a program stopped for good.** Floor's `parse_guardian_set` (and the Vault's) accepts `threshold == count` (2-of-2, 3-of-3), and `can_eject` needs `count > threshold`, so nobody in such a set can be ejected. In a 2-of-2 set, the rogue stops the program; a restore needs a quorum, which needs the rogue; it vetoes the owner's RESTORE, and every new SetGuardians or ReleaseAuthority, as each is proposed. The recovery key rotates only the owner. This is AUD-2 (`16`) without the lost key: one key alone, where G5 says a live quorum of the others ejects a rogue. In the Vault the same set lets one rogue guardian renew freezes and veto every loosening indefinitely; own deposits still leave (G2). | Fixed (on-chain, Floor and Vault; on devnet since 15 Oct, PR #85). Both `parse_guardian_set`s call the core's `guardian_set_ok`: `2 ≤ threshold < count ≤ 8`, so a set has at least 3 keys. Kani `accepted_sets_can_eject_anyone` proves an accepted set is exactly one where every guardian can be ejected by the others; the differential gained `GV` (Rust = Python). Tests: `registration_rejects_weak_settings` (Floor, 2-of-2 and 3-of-3), `an_n_of_n_guardian_set_is_refused` (Vault); both fail on the previous build. The guardian still warns below `threshold + 2`. | +| 97 | 13 Oct | Review of the Vault after the submission (as 96) | **A stolen admin key can burn value on a fee-bearing mint by cycling the lifeboat.** `TransferFeeConfig` mints are allowed (`05` §7), and Token-2022 withholds the fee on every `transfer_checked`, even between two accounts the vault PDA owns. After the seal, `lifeboat_move` (admin, instant while not frozen) and `lifeboat_return` (the admin alone) can be paired many times in one transaction, before any guardian can act: at 1%, about 30 round trips withhold about 45% of the vault as fees. The attacker gains nothing (withheld fees go to the mint's withdraw authority), but depositors lose it, and no guarantee covers it: it is not unbacked outflow (G1) and not an exit (G6). The fee's per-transfer maximum caps the loss. | Fixed (on-chain, Vault; on devnet since 15 Oct, PR #85). `lifeboat_move` refuses a mint whose TransferFeeConfig has a fee config authority or a non-zero older or newer fee (`FeeBearingMint`, 8055); `lifeboat_return` is unchanged, so funds always come back. Test: `the_lifeboat_refuses_a_mint_that_charges_or_can_charge_a_transfer_fee` (fails on the previous build). | +| 98 | 13 Oct | The same review | **The caller PDA's own signature counts as a borrower's consent.** `release` refuses a recipient owned by the vault or protocol PDA, but not by the caller PDA, and the caller signs every release. An integrator that deposits through its caller PDA as the authority (a pooled design) therefore has its ledger's loans consented automatically: a compromised protocol program (T2) borrows other mints through the backed lane, up to the haircut value, with no user signature, which finding 74 meant to rule out. A freeze still caps it at the owner's own balance (finding 90). Harbor's flow, where the user is the deposit authority, is unaffected. Also found, informational: a change's payload accepts trailing bytes that no rule reads (a review UI could show them as meaningful), and a mint's freeze authority can set DefaultAccountState to Frozen after `create_vault`, so a lifeboat created later is born frozen (covered by trusting the issuer, `07` §2). | Fixed (on-chain, Vault; on devnet since 15 Oct, PR #85). In `release`, when the recipient's owner is the caller PDA its signature is never consent: the backed amount is capped at the ledger's own balance of the mint (G2 unchanged: that balance still leaves instantly). Refusing such a recipient outright, as first proposed, would have stopped a pooled integrator's own-deposit withdrawals. Test: `the_callers_own_signature_is_not_consent_to_a_loan` (on the previous build, 50,000 USDC was paid as a backed loan with no user signature). The trailing-payload note stays informational. | +| 99 | 14 Oct | Adversarial audit of Floor (an AI-agent review with a LiteSVM PoC, against agave's loader 4.2.2) | **A stranger could make a release fail, round after round.** `pin_snapshot` is open to anyone while the program is live, and `ReleaseAuthority` refused unless it named whatever was pinned when it executed. A stranger who landed `pin_snapshot` with its own frozen copy of the live code just ahead of the owner's release made it fail (`WrongBuffer`), and could repeat this until the proposal expired; the owner then waited the delay again. The race finding 66 closed for `abort`, open on the release path. Low: delay only, one buffer's rent per round. | Fixed (on-chain, Floor; on devnet since 15 Oct, PR #85). While the program is live, a passed frozen buffer byte-identical to the live code stands in for the pin, as in `abort`, and is closed to the owner with the spares; the stranger's copy keeps the stranger's rent. Test: `a_strangers_re_pin_cannot_make_a_release_fail` (fails on the previous build). | | 100 | 14 Oct | Adversarial audit of the limiter and queue (an AI-agent review with a LiteSVM PoC) | **One round trip by a large holder still shrinks the unbacked lane for a day.** Finding 65's low-water base recovers within two windows, but a payout made during the dip is charged at the dipped capacity (`cost_ms` is `⌈u·W/C⌉` at request time) and that reservation stays. A holder of 90% of a 10M vault who withdraws and re-deposits in one transaction (only the fee) cuts capacity tenfold; an honest 100k payout a minute later waits 24h instead of being instant, and the lane has no instant room 21 hours later. Repeating it once per window keeps the lane at a tenth. Low: availability only, never more outflow (G1 holds). Not E5 (an owner's own tickets): here a holder delays others' payouts. | Stated (`03` §3 corrected: the base recovers, reservations made during the dip do not). The fix that removes it, using the low-water base only to decide instant room and charging reservations at `min(reference, balance)`, re-opens G1's refill argument against flash deposits and so belongs with the audit, with the same change in `reference/bulkhead_ref.py` and `cloud/lib/limits.mjs`. Guardians and status pages should read a sudden queue after a large round trip as this, not an attack. Test pinning today's behaviour, which the fix must flip on purpose: `a_round_trip_dip_charges_payouts_at_the_dipped_capacity`. | -| 101 | 14 Oct | Adversarial audit of the core math (an AI-agent review; a failing core test, then a LiteSVM test) | **A reset on a clock that stepped back granted more than an empty bucket.** `reset_backlog` clamps each bucket to "just emptied", `now + W`, and the Vault passed the raw `Clock` time. After a drain, a reset at a clock δ behind the latest time seen gave `C·δ/W` of fresh room beyond G1, to the admin alone or one guardian. The Vault already kept a high-water time (`ref_updated_s`, finding 75) but not here. G1's reset step assumes the reset time is the latest seen. Low: needs the cluster clock to step back. | Fixed (on-chain, Vault; not yet on devnet). The reset clamps at `max(now, ref_updated_s)`. Test: `a_reset_on_a_clock_that_stepped_back_grants_nothing_extra` (on the previous build, 196,000 USDC of room after a 1h step back; now 0). The core function is unchanged; the program-vs-model differentials never step the clock back. | +| 101 | 14 Oct | Adversarial audit of the core math (an AI-agent review; a failing core test, then a LiteSVM test) | **A reset on a clock that stepped back granted more than an empty bucket.** `reset_backlog` clamps each bucket to "just emptied", `now + W`, and the Vault passed the raw `Clock` time. After a drain, a reset at a clock δ behind the latest time seen gave `C·δ/W` of fresh room beyond G1, to the admin alone or one guardian. The Vault already kept a high-water time (`ref_updated_s`, finding 75) but not here. G1's reset step assumes the reset time is the latest seen. Low: needs the cluster clock to step back. | Fixed (on-chain, Vault; on devnet since 15 Oct, PR #85). The reset clamps at `max(now, ref_updated_s)`. Test: `a_reset_on_a_clock_that_stepped_back_grants_nothing_extra` (on the previous build, 196,000 USDC of room after a 1h step back; now 0). The core function is unchanged; the program-vs-model differentials never step the clock back. | | 102 | 14 Oct | The same review | **The README promised a per-hour cap the limiter does not enforce.** "At most 4% leaves in any hour and 10% in any day" reads as payouts per wall-clock window, but G1 (`03` §2.5) counts payouts by when they were requested. Tickets reserve capacity as they are requested and can share an ETA of `now + D`: at the defaults one request of 625,000 USDC on a 10M vault (6.25%, `C_l·(W_l+D)/W_l`) is paid in one go 6h later. G1 as stated holds; the sentence did not. | Stated; the claim corrected (README, `02` §1, `03` §2.6). The queue's promise is 6h in public in which any guardian can cancel. Capping payouts per wall-clock window needs a settle-time bucket, a mechanism decision left to the team. Test: `one_request_can_queue_a_long_window_plus_the_delay` (core). | -| 103 | 14 Oct | A Kani harness written for the shared guardian-set code (PR B of the code-quality plan) | **Guardian liveness could panic on far-apart times.** `guardian_alive` checked `now ≥ last` and then computed `now − last` in i64: with a negative heartbeat time (`now = 0`, `last = i64::MIN`) the gap overflows, and with overflow checks on that is a panic. Not reachable on chain: every heartbeat is the cluster clock or 0, which is why the G5 harness, which assumes non-negative times, never saw it. The differential's `GH` inputs never left that range either. | Fixed (core; in the programs from PR B, not yet on devnet). The gap is a checked subtraction, and an overflow means not alive, which is what the unbounded Python reference already returns. The `GH` generator now draws times across all of i64; the previous core crashes the Rust worker on them (exit 101), and the fix agrees with Python on every line. | +| 103 | 14 Oct | A Kani harness written for the shared guardian-set code (PR B of the code-quality plan) | **Guardian liveness could panic on far-apart times.** `guardian_alive` checked `now ≥ last` and then computed `now − last` in i64: with a negative heartbeat time (`now = 0`, `last = i64::MIN`) the gap overflows, and with overflow checks on that is a panic. Not reachable on chain: every heartbeat is the cluster clock or 0, which is why the G5 harness, which assumes non-negative times, never saw it. The differential's `GH` inputs never left that range either. | Fixed (core; in the programs from PR B, on devnet since 15 Oct, PR #85). The gap is a checked subtraction, and an overflow means not alive, which is what the unbounded Python reference already returns. The `GH` generator now draws times across all of i64; the previous core crashes the Rust worker on them (exit 101), and the fix agrees with Python on every line. | | 104 | 14 Oct | Measuring the worst case nobody had (the code-quality review, then a LiteSVM test through Harbor with sizes checked against the SDK's own serialization) | **A borrower with many mints cannot be paid in a legacy transaction.** `release` names 11 fixed Vault accounts plus an (asset, price) pair for the paid mint and each other mint in the owner's ledger (14 fixed keys through Harbor: the Vault's 11, the two programs and the user). Compute is not the limit in the measured cases: 76,887 CU through Harbor with a full ledger of 8 and a 200,000-token over-ask, net of two PDA bump searches (Harbor's caller and the ticket's), 1,500 CU per step each; CI's Linux run had 3 caller steps and 6 ticket steps (90,387 CU). It is not a ceiling: the backed-amount search grows with log₂ of the amount, and asset PDAs of mints without records, or the backing PDA of an owner with no ledger yet, add their own searches. Size is: a borrow against a full ledger is 1,176 of 1,232 bytes with a relayer paying, and paying a ninth mint is 1,242 bytes. Nothing breaks on chain and no funds are at risk; an integrator who builds legacy transactions fails to send them. Low: integration liveness. | Stated, and pinned: `a_full_ledger_release_is_cheap_but_a_ninth_mint_needs_v0` asserts under 80k CU net of both bump searches (76,887 on every run, on macOS and on CI), one pair per mint and the key count, the borrow fitting and the ninth mint not, that a mint outside a full ledger is never backed (a mint outside a 4-mint ledger is: a new position), and that with placeholder price accounts it fits (954 bytes); `a_four_mint_ledger_release_fits_with_room`. The test fails if the full-ledger rule in `backed_amount` is removed. `07` §2: v0 transactions with a lookup table for the accounts that are the same on every release, compute limits set from a simulation, and placeholder price accounts only where no price can change the outcome (three cases named; elsewhere they can take the backing away, and the test pins that a borrow with them is not backed). `05` §10 has the figures. Lowering `MAX_SLOTS`, or pricing only what a release needs, are mechanism changes left to the team. | Same review, not changed then: the guardian-set checks were written once in each program. Since PR B (finding 103), both use one `GuardianSet` in the core, covered by the `guardian_set` fuzz target, the `GP` differential and unit tests (its bitmaps are Kani-proved; a Kani proof of the parser did not finish, §5.3). `Change` payloads are now copied in one slice instead of byte by byte (fewer compute units), and the Ticket layout comment names the real seeds. @@ -361,7 +361,7 @@ The overflow guards stay in the code as defense in depth; the tests document why | **Compute** | Measured through Harbor's CPI (`05 §10`) and for Floor (`06 §7`) | Within targets | | **End-to-end** | A real validator booted with a sealed market; the guardian freezes on its own and cancels; the page's figures equal `attest` | Pass | | **On devnet** | The demo market before its seal, checked without sending anything (`cloud/deploy/vault-check.mjs`); Floor's lifecycle with real transactions on a target program (`scripts/floor-devnet.sh`) | Market: as configured, page = `attest`, 11/11 forbidden actions refused (with the Vault upgraded in place on 29 Sep: an admin abdicating without a guardian quorum is refused). Floor: stopped, restored byte-identical, 17/17 refused (`08`) | -| **Reproducible builds** | A clean rebuild reproduces the binaries' sha256 on the same host; `scripts/verify-deployed.sh` dumps deployed programs and requires the local build byte for byte, read at `confirmed` (run inside `scripts/deploy-dryrun.sh`); with `EXPECT_AUTHORITY` it also requires the upgrade authority, which `scripts/verify-devnet.sh` sets to the team key. Release binaries come from Linux x86_64, natively (CI) or in the pinned verifiable-build image (`scripts/build-programs-docker.sh`) | Deterministic per host; another host orders the Vault's functions differently (finding 43). On 11 Oct all three devnet programs (PR #77) were matched byte for byte against CI's Linux build, with the upgrade authority checked (hashes in `SECURITY.md`); CI repeats it weekly (`scripts/verify-devnet.sh`) | +| **Reproducible builds** | A clean rebuild reproduces the binaries' sha256 on the same host; `scripts/verify-deployed.sh` dumps deployed programs and requires the local build byte for byte, read at `confirmed` (run inside `scripts/deploy-dryrun.sh`); with `EXPECT_AUTHORITY` it also requires the upgrade authority, which `scripts/verify-devnet.sh` sets to the team key. Release binaries come from Linux x86_64, natively (CI) or in the pinned verifiable-build image (`scripts/build-programs-docker.sh`) | Deterministic per host; another host orders the Vault's functions differently (finding 43). On 15 Oct all three devnet programs (PR #85) were matched byte for byte against CI's Linux build, with the upgrade authority checked (hashes in `SECURITY.md`); CI repeats it weekly (`scripts/verify-devnet.sh`) | | **security.txt** | The standard `.security.txt` ELF section (contact details readable from the binary). Tried on the Vault with the program toolchain: the linker puts the section inside the executable segment. Unpadded, Agave's v3 loader refuses the binary (`Invalid ELF program header`, the segment is no longer a multiple of 8 bytes); padded, its verifier reads the text as instructions (`jump out of code`). It also needs `#[link_section]`, which `deny(unsafe_code)` forbids | Not shipped: incompatible with sBPF v3 (SIMD-0189's strict layout). Contacts are in `SECURITY.md`; registering the builds with `solana-verify` carries the source link | | **After the hackathon** | Certora (CVLR) rules for I8, I11, I12; Trident flows; registering the builds with `solana-verify` | Planned with the audit build (`10 §2`) | diff --git a/docs/12-SUBMISSION.md b/docs/12-SUBMISSION.md index c3e2288..837a5a1 100644 --- a/docs/12-SUBMISSION.md +++ b/docs/12-SUBMISSION.md @@ -19,7 +19,7 @@ Bulkhead was submitted to the Colosseum Crypto World's Fair (Solana track) on 12 | Floor on a real 1 MB mainnet program's bytes | `scripts/floor-demo.sh ` (`06 §7`) | | The attacker-vs-guardian run, end to end | `E2E=1 scripts/check-programs.sh` | | Every test, proof and differential result | `09`; `scripts/check.sh`, `scripts/check-programs.sh`, `scripts/prove.sh` | -| Every bug the process found in our own code | `09 §4` (95 findings at submission; 96–98 recorded on 13 Oct, each stated with its fix); `16` | +| Every bug the process found in our own code | `09 §4` (95 findings at submission; 96–104 recorded 13–14 Oct: 96–99, 101 and 103 fixed and on devnet since 15 Oct, 100, 102 and 104 stated); `16` | | Every number's source and label (measured, reported, model, assumption) | `01`, `13` | ## 3. Go-to-market diff --git a/docs/16-AUDIT-REPORT.md b/docs/16-AUDIT-REPORT.md index 887b821..74d6a83 100644 --- a/docs/16-AUDIT-REPORT.md +++ b/docs/16-AUDIT-REPORT.md @@ -38,7 +38,7 @@ No finding allows a theft without a key. Every proven issue needed a key comprom | 87b | Low | More than 10 vaults can never seal | Fixed: at most 10 before the seal | | 87c | Low | Harbor's REGISTER is first-come | Stated, with the remedy (`07` §2) | | 89 | Low | A payout to an account the protocol PDA owns | Fixed; an account another Vault PDA owns is stated | -| AUD-2 | Medium | A lost guardian key plus a rogue guardian lock a 2-of-3 set's governance; in an n-of-n set one rogue guardian alone does (`09`, finding 96) | To decide (§4); n-of-n to be refused in the audit build | +| AUD-2 | Medium | A lost guardian key plus a rogue guardian lock a 2-of-3 set's governance; in an n-of-n set one rogue guardian alone does (`09`, finding 96) | To decide (§4) for the 2-of-3 case; n-of-n refused since finding 96 (on devnet since 15 Oct, PR #85) | | E1–E3 | High (design) | The backed lane has no brake; loan consent is any signature in the transaction; liquidations queue in a crash | To decide (§4) | | E4–E8 | Medium–Low | Patient drain and the bot's allowlist; queue griefing; optional caps; instant lifeboat move after the window | Stated (`09`, finding 89); §4 | | Others | Info | Freezes do not stop `execute_change` or `execute_exit` (vetoes do); role overlaps the destination may have; re-proposals clear vetoes; delegate deposits; the second Pyth receiver; SIMD-0500 and release to none | Stated in `09` 87–89 | diff --git a/docs/FAQ.md b/docs/FAQ.md index 4715679..f635fc6 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -103,4 +103,4 @@ Measured on the real runtime, through a protocol's CPI: Measured 8 Oct 2026 on a macOS build. See `05 §10` and `06 §7`. **Is it live?** -On devnet, since 28 Sep 2026, with test tokens only (ids in the README). Devnet runs this tree's build (PR #77, 11 Oct), checked byte for byte. Not on mainnet. The programs also pass their tests on the real Solana runtime (LiteSVM) and in an end-to-end run on a local validator. Nothing is audited; don't use it with real funds. +On devnet, since 28 Sep 2026, with test tokens only (ids in the README). Devnet runs this tree's build (PR #85, 15 Oct), checked byte for byte. Not on mainnet. The programs also pass their tests on the real Solana runtime (LiteSVM) and in an end-to-end run on a local validator. Nothing is audited; don't use it with real funds.