Repository navigation
feat: add GLOAS pubkey-cache poisoning playbook (topup + slash) - #248
barnabasbusa wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Summary
Adds one new data-only playbook, playbooks/gloas-dev/pubkey-cache-poison-topup-slash.yaml, which stages a top-up, a 0xB0 builder deposit and a 0x01 validator deposit inside the unfinalized pre-fork window, slashes the topped-up victim, and then asserts finality/forks/builder-A/validator-B after GLOAS activates. The structure mirrors the existing builder-prefork-onboard playbook and the task names/configs I checked line up with the task implementations, but the pre-fork window guard leaves a hole where the staging can slip past the fork and the test still passes, and the slash itself is never asserted to have landed.
Issues
- 🟡
playbooks/gloas-dev/pubkey-cache-poison-topup-slash.yaml:128— fail-fast window guard still admits starts too late to stage deposits + slash — see the thread on that line - 🟡
playbooks/gloas-dev/pubkey-cache-poison-topup-slash.yaml:292— slash submission is not asserted, so a failed slashing silently voids the test — see the thread on that line - 🟢
playbooks/gloas-dev/pubkey-cache-poison-topup-slash.yaml— generated playbook index not updated — playbooks/_index.yaml (regenerated with make generate-playbook-index, and what pkg/playbooklibrary serves to the UI library tab) has no entry for this new gloas-dev/pubkey-cache-poison-topup-slash.yaml, so the playbook stays invisible in the library until someone regenerates the index.
Reviewed @ f8b1a284
"A camel is a horse designed by committee."
|
|
||
| # Need headroom before the fork to land both the deposits and the slash. | ||
| LATEST_DEPOSIT_SLOT=$((ACTIVATION_SLOT - 3)) | ||
| if [ "$CURRENT_SLOT" -ge "$LATEST_DEPOSIT_SLOT" ]; then |
There was a problem hiding this comment.
🟡 fail-fast window guard still admits starts too late to stage deposits + slash
The guard only rejects CURRENT_SLOT >= ACTIVATION_SLOT - 3, so a start at ACTIVATION_SLOT - 4 or later than DEPOSIT_SLOT is accepted; the slot waits then return immediately and the three generate_deposits tasks (each with limitPerSlot: 1, so they consume successive blocks) plus the slash need to fit in the remaining ~4 slots. If any of them lands after ACTIVATION_SLOT, the top-up is no longer pending at the fork, the whole reorder premise disappears, and phase 5's finality/fork/builder checks pass vacuously instead of failing fast as the description promises. The headroom check should account for the deposits+slash that must still land before the fork (and reject starts past DEPOSIT_SLOT).
| configVars: | ||
| minSlotNumber: "tasks.calc_slots.outputs.slashSlot" | ||
|
|
||
| - name: generate_slashings |
There was a problem hiding this comment.
🟡 slash submission is not asserted, so a failed slashing silently voids the test
generate_slashings only logs error generating slashing when generateSlashing returns an error and then falls out of its loop and returns nil, so the task reports success even though nothing was submitted. Since this attack depends entirely on V0 being slashed before the fork, a rejected/skipped proposer slashing (e.g. V0's status changed between the earlier active_ongoing check at line 188 and this task) leaves all the post-fork checks passing without the bug ever being exercised; asserting includedSlashings == 1 or the slashed status of V0 before phase 5 would close that.
|
there's also a simpler construction, from claude below 🤖
Both end states sit at slot 56 with the same finalized checkpoint, epoch 4 with root This violates the intent as well as the letter. A client that keeps one index-to-pubkey map across both chains reads the wrong key at index 64 on one of them. The cause is that the fork changes what a queued deposit becomes, at a fixed epoch. The queue position a chain has reached by that epoch depends on when that chain finalized the deposit's slot. Heze has the same split: EIP-8365 drops a queued |
|
I don't think this playbook can trigger the poisoning as written, so a green run won't show whether a client is fixed. We reproduced the bug in Lodestar (both of our state transitions are affected, fix in progress) and checked this playbook's flow against the spec:
To catch it, the playbook needs that second branch. That could be the construction in the comment above (one branch finalizes the deposit slot before the fork, the other doesn't). Or it could be the top-up + slash variant, with the deposits already finalized at the F-1 → F transition and the slashing included only on the side branch, before the fork. Either way the victim has to run the side branch's F-1 → F transition (import a side-branch block from epoch F or later, or compute that branch's epoch-F checkpoint state) before the canonical transition that gives B its index (F → F+1 in the top-up + slash variant). On Lodestar the canonical transition then fails with |
Adds a
gloas-devregression playbook for the validator pubkey-cache poisoning attack fixed in sigp/lighthouse#10569 — the "topup a validator then slash it right before the builder early-onboarding" case we had not tested. Inside the unfinalized window before the GLOAS fork it stages three still-pending deposits in order (a large top-up for an existing validator V0 that consumes the deposit churn, a0xB0builder deposit A, and a0x01validator deposit B), then slashes V0 before the fork so its pending top-up is skipped at the epoch boundary and the queued deposits reorder — the exact divergence that binds the wrong pubkey in a buggy global/eager pubkey cache. It then asserts the network stays healthy across the fork (fresh finality past the pre-attack checkpoint, no unexpected fork), builder A is onboarded, and validator B is onboarded and goes active (its index→pubkey mapping held and its signatures are accepted network-wide); a poisoned node rejects B and forks off, which the finality/fork checks catch. This is a single-chain reproduction and the timing is load-bearing and devnet-dependent (topupAmountand the slot offsets are config knobs); it fails fast if started after the pre-fork window. Note it permanently slashes V0, so pointvictimMnemonicat a disposable genesis validator.