Conflict-winner promotion (SwapBlock) skips the timekeeper attestation freshness check — a stale lease_settle past the grace window commits and mints emission
Report
Summary
SwapBlock (conflict-winner promotion) validates the winning block with the
attestation freshness check disabled, so a lease_settle carrying stale
timekeeper attestations commits through the conflict path even though the live
POST path rejects the identical block. In a local harness I settled a lease
~72 hours past its grace window using attestations ~3 days old (median still
inside the grace window): the live path rejected the block with "only 0 valid
attestations from trusted timekeepers, need 2", while the conflict path
committed it, burned the escrow, and minted 667 µXE of emission. The grace
window — the mechanism that is supposed to make a late settle impossible — is
bypassed entirely on this path.
What I did
All testing in a local Go harness against the public repo (HEAD 02e9641). testnet-0005 was not touched, no live XUSD was used, no local testnet was run, and no other user's funds, keys, or workloads were involved.
Harness: poc-n1/main.go (package main inside a clone of the repo, same
module). Go 1.27.3. Simulated clock via core.Now. Genesis overridden with a
local keypair whose representative holds 100% of the delegated weight;
Difficulty=0; local timekeeper threshold 2. XUSD/XE balances seeded via the
test helpers MintForTesting / SeedAssetForTesting.
Scenario:
- T0: consumer opens a lease (60 s duration, cost 667 µXUSD); provider
accepts with attestations @T0,
LockedR=1000→ emission 667 µXE. Expiry T0+60 s, grace until T0+3660 s. Lease + accept finalized. - T0+3 days: the lease is ~71 h 59 min past its grace window.
- Control: the same stale
lease_settle(attestations @T0+30 min, median inside the grace window) submitted viaAddBlockwith no sibling. - Exploit: provider first commits a
sendsibling on the samePrevious(the accept hash), then submits the stalelease_settleground (viaTimestamp, 1 ns steps, 3 tries) to the lowest hash so the rep prefers it. Rep final-votes it;confirmConflict→SwapBlock→ commit.
The harness was run 5 times in a row; all 5 runs were identical (same
hashes, same control rejection, same exploit outcome, same balances, exit 0,
N-1 REPRODUCED).
What happened
Control — live path (AddBlock, no sibling): REJECTED
- Settle hash
fc05c86525ac421d66c6539387eedf761484b76b6dcde7b618e97f6b25f91319 AddBlock rejected as expected: lease_settle attestation: only 0 valid attestations from trusted timekeepers, need 2
Exploit — conflict path (SwapBlock): COMMITTED
- Send sibling committed first:
49316a2498f685ac103e58b7d0b293a32e85e902256d4a8474e07bd029116cc6 - Stale settle (attestations @T0+30 min) ground to the lowest hash:
0ddba5d60182d53105406f077c493b49d9dc399f81a56373d3dd3e4a559f3b12(3 tries) - Conflict recorded (
totalWeight=42000000000000); rep final-voted the settle (weight 42000000000000 = 100%);confirmConflict→SwapBlock→ commit. - Verified outcome: settle on-chain and at the frontier; the send is removed
from the canonical chain (status Rejected); escrow pending is gone; lease
state =
settled; provider XE balance 1,000,000 → 1,000,667 (667 µXE of emission minted).
Impact
- The settle grace window is bypassed on the conflict path: a provider can settle a lease long after expiry+grace, burning the escrow and minting emission the protocol says should not be minted after grace.
- The same bypass applies to the sibling block types validated through the
same path:
lease_acceptlocks stale-epoch emission parameters (validateLockedEmissionAtreads the stale time) andlease_force_settlerefunds at a staleforceTime. - Cheap to attempt in principle: it needs one lease, one conflicting send, and the stale block ground to the lowest hash (the rep auto-votes the lowest hash among candidates it knows).
- This is Medium, not High: on a live network the attacker must win a race — both siblings must be visible to the rep within the ~3 second stability window, and the stale block must be the lowest hash among the candidates the rep knows. The harness also simplifies the network (see Notes).
Expected behavior
Conflict promotion should apply the same attestation freshness check as the
live path, or stale-attestation blocks should be rejected at staging /
promotable time. A block that the live path rejects for stale attestations
should not become committable by being wrapped in a conflict.
Root cause (code, public repo HEAD 02e9641)
core/ledger.go:3003(SwapBlock): callsdispatchValidateAndAdd(newBlock, true)— thetrueisskipTimestamp, whichlease_settletreats asskipSkew=true. InvalidateAndAddLeaseSettle(core/ledger.go:2117-2250) this reachesValidateAttestations(..., skipSkew=true), skipping the ±10 minute attestation freshness check; the median-time gate (settleTime >= expiry && settleTime <= expiry+Grace,core/ledger.go:2161-2175) then reads the stale median and passes.core/quorum.go:236-266(promotable): only runsValidateStagedBlock, which forlease_settle/lease_accept/lease_force_settleonly checks balance + pending escrow — no attestation check (core/ledger.go:2732-2862).core/finalization.go:139(castVoteLocked) →lowestHash(core/vote.go:271): the rep automatically votes the lowest-hash sibling, so a ground stale block wins the vote.
Relation to XE-0010 (not a duplicate)
XE-0010 (Accepted) is about the same kind of gap on a different path: sync
ingestion (AddSyncedBlock) skips the freshness check. This report is a
different code path (SwapBlock, conflict-winner promotion), a different
entry point, and a sharper impact (grace-window bypass + emission minted,
versus a lapsed renewal committing as history). A fix that only touches the
sync path does not close this path. XE-0010 itself states its scope is
"the /xe/sync path" and does not mention SwapBlock or promotion.
Reproduction steps
- Clone the public repo at HEAD 02e9641; Go ≥ 1.25.
- Place the harness at
poc-n1/main.go(packagemain, same module) and run from the repo root:go run ./poc-n1 - Observe the control: the stale settle is rejected on the live path ("only 0 valid attestations from trusted timekeepers, need 2").
- Observe the exploit: the send sibling commits, the stale settle is ground
to the lowest hash, the rep final-votes it,
confirmConflict→SwapBlockcommits it, and the provider balance goes 1,000,000 → 1,000,667 µXE. - Re-run 5 times — the harness is deterministic (identical hashes and verdicts in all 5 runs).
Evidence
- Harness:
poc-n1/main.go(attached). - Full logs of the 5 verification runs:
rerun-20261110-1.log…rerun-20261110-5.log(all exit 0,N-1 REPRODUCED; identical except for the wall-clock second in the genesis log line). - Earlier full log + result summary:
run-20261110-3.log,RESULT.md. - Key hashes (identical in all 5 runs): control settle
fc05c86525ac421d66c6539387eedf761484b76b6dcde7b618e97f6b25f91319; send sibling49316a2498f685ac103e58b7d0b293a32e85e902256d4a8474e07bd029116cc6; exploit settle0ddba5d60182d53105406f077c493b49d9dc399f81a56373d3dd3e4a559f3b12.
Notes
- The harness simplifies the network: one rep holds 100% of the delegated
weight (similar to the public ldn node's dominance on testnet-0005, but
still a simplification) and
Difficulty=0. On a live network there is a race: the rep has a ~3 second stability window, so the attacker must make both siblings visible to the rep within that window, sincecastVoteLockedpicks the lowest hash among the candidates it already knows. - Side finding while building the harness:
PoWNonceis NOT part of the block-hash preimage (HashBlock= canonical + aux; the nonce only appears in the binary wire formatMarshalBlock). Hash grinding must therefore go through a hashed field — in this PoC,Timestampin 1 ns steps, staying inside the ±1 hour window. "Grind the nonce to the lowest hash" does not work as-is on the live network. lease_renewcannot be a conflict candidate on this path:ValidateStagedBlockhas nocase BlockLeaseRenew→ "staged block: unknown type: lease_renew" (core/ledger.go:2867; = GitHub #4 F3.3). So this report is specifically about settle / accept / force-settle.- No testnet-0005 interaction, no live XUSD, no local testnet, no other user's funds, keys, or workloads were touched.
Thread
Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, file a new report that links https://bounty.xe.network/XE-2530 and says what differs; it is read like any other.