Description
resolve computes let payout = assertion.bond * 2; when a dispute resolves, but initialize only rejects bond_amount <= 0. There is no upper bound, so a large enough bond_amount overflows on the doubling.
Steps to reproduce
- Call
initialize with bond_amount close to i128::MAX (anything greater than i128::MAX / 2).
- Have an asserter post an assertion and a disputer dispute it.
- Have resolvers vote to a majority.
Expected behavior
initialize rejects a bond_amount that could overflow bond * 2 during resolution, with a new Error variant (e.g. InvalidBondAmount extended, or a new variant).
Actual behavior
initialize accepts the value. The overflow happens later, inside resolve, at the point the payout is computed, permanently stranding both bonds since the dispute can never successfully resolve.
Environment
- Network: local
- Contract: tholos
- Commit or tag: f9ad187
Possible impact
Yes, this affects fund safety: both the asserter's and disputer's bonds become permanently locked in the contract once a dispute on an overflow-prone assertion is resolved, since the payout transfer can never succeed. This does not rise to a live vulnerability requiring private disclosure since it requires the admin to configure an extreme bond_amount, not something an attacker can trigger against a sanely configured deployment, so a public issue is appropriate rather than SECURITY.md.
Description
resolvecomputeslet payout = assertion.bond * 2;when a dispute resolves, butinitializeonly rejectsbond_amount <= 0. There is no upper bound, so a large enoughbond_amountoverflows on the doubling.Steps to reproduce
initializewithbond_amountclose toi128::MAX(anything greater thani128::MAX / 2).Expected behavior
initializerejects abond_amountthat could overflowbond * 2during resolution, with a newErrorvariant (e.g.InvalidBondAmountextended, or a new variant).Actual behavior
initializeaccepts the value. The overflow happens later, insideresolve, at the point the payout is computed, permanently stranding both bonds since the dispute can never successfully resolve.Environment
Possible impact
Yes, this affects fund safety: both the asserter's and disputer's bonds become permanently locked in the contract once a dispute on an overflow-prone assertion is resolved, since the payout transfer can never succeed. This does not rise to a live vulnerability requiring private disclosure since it requires the admin to configure an extreme
bond_amount, not something an attacker can trigger against a sanely configured deployment, so a public issue is appropriate rather than SECURITY.md.