You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PaymentPool: a capability registered with expiry 0 permanently disables that signer for the pool #2697
Source: GHSA-7mcp-75qw-gr3j (internal report, re-confirmed on main).
PaymentPool._registerCapability (contracts/src/PaymentPool.sol:815-831) accepts an owner-signed capability whose expiry is 0, or any other time already in the past. _applyVoucher (:871-890) pays nothing when block.timestamp >= a.expiry. Registration is write-once: once a.cap != 0 || a.expiry != 0, every later registration for the same (poolId, signer) returns early. Nothing revokes a signer. A registration with a nonzero cap and expiry = 0 therefore pins that signer to terms that can never pay. Every voucher from it on that pool redeems for 0, and the owner cannot repair the registration.
Exposure is narrow. The registration needs an owner signature over expiry = 0, which neither the CLI nor sponsord produces. Any redeemMany caller can submit such a signature, though. Pool funds are not lost.
Revert with a new error (for example InvalidCapabilityExpiry) when expiry <= block.timestamp, before the signature check
Foundry test: an owner-signed CapabilityReg with a nonzero cap and expiry = 0 reverts, getAuthorization stays empty, and a later valid registration succeeds
Mirror the new error in the Rust sol! bindings and update the gas snapshot
This is more severe than the expiry-0 framing suggests: the same write-once registration with no term sanity check (_registerCapability, contracts/src/PaymentPool.sol:815-831) lets a malicious pool owner void vouchers nodes have already earned, not just mis-register a signer by accident.
Route: the owner hands nodes a generous off-chain capability for signer S; nodes verify the owner signature and serve, deferring on-chain registration to first redemption (crates/node/src/payment_settlement.rs). Before any node's first redeem lands, the owner — or anyone, since redeemMany is permissionless and a batch may carry capabilities with zero vouchers (PaymentPool.sol:596-598) — registers a second owner-signed capability for S with cap = 1 (or any past expiry). Registration is first-wins, so every voucher S signed now redeems for at most 1 unit (_applyVoucher clamps at a.cap - a.spent) or nothing. The owner then closes and reclaims the full deposit, rotates signers, and repeats; no fee is paid since totalPaid is 0. Nodes lose everything served between admission and first redemption. A rival node holding an older owner-signed capability for the same signer can grief competitors the same way.
Implication for the fix: rejecting expiry <= block.timestamp closes only the expiry variant — a lowball cap registration still voids earned vouchers. Registration needs to be monotone (a later valid owner signature may only raise cap / extend expiry, e.g. take the max, or highest-nonce-wins), or nodes need to register the capability they serve against before serving. Interacts with the revocation design in #2375. Suggest raising prio to high.
Fixed by #2833 (560465f): PaymentPool._registerCapability returns before recording when spendingCap == 0 || expiry <= block.timestamp, so a dead capability can no longer claim the (poolId, signer) slot.
Activity
yigitdot commentedon Oct 30, 2026
This is more severe than the expiry-0 framing suggests: the same write-once registration with no term sanity check (
_registerCapability,contracts/src/PaymentPool.sol:815-831) lets a malicious pool owner void vouchers nodes have already earned, not just mis-register a signer by accident.Route: the owner hands nodes a generous off-chain capability for signer S; nodes verify the owner signature and serve, deferring on-chain registration to first redemption (
crates/node/src/payment_settlement.rs). Before any node's first redeem lands, the owner — or anyone, sinceredeemManyis permissionless and a batch may carry capabilities with zero vouchers (PaymentPool.sol:596-598) — registers a second owner-signed capability for S withcap = 1(or any past expiry). Registration is first-wins, so every voucher S signed now redeems for at most 1 unit (_applyVoucherclamps ata.cap - a.spent) or nothing. The owner then closes and reclaims the full deposit, rotates signers, and repeats; no fee is paid sincetotalPaidis 0. Nodes lose everything served between admission and first redemption. A rival node holding an older owner-signed capability for the same signer can grief competitors the same way.Implication for the fix: rejecting
expiry <= block.timestampcloses only the expiry variant — a lowballcapregistration still voids earned vouchers. Registration needs to be monotone (a later valid owner signature may only raise cap / extend expiry, e.g. take the max, or highest-nonce-wins), or nodes need to register the capability they serve against before serving. Interacts with the revocation design in #2375. Suggest raising prio to high.Generated by Claude Code
thiras commentedon Nov 3, 2026
Fixed by #2833 (560465f):
PaymentPool._registerCapabilityreturns before recording whenspendingCap == 0 || expiry <= block.timestamp, so a dead capability can no longer claim the(poolId, signer)slot.