Trust-Machines/multisafe

[BUG] Owners can set min-confirmation > 20 and by doing so they can lock safe permanently.

Closed this issue · 5 comments

LNow commented

(define-public (set-min-confirmation (value uint))
(begin
(asserts! (is-eq tx-sender SELF) ERR-CALLER-MUST-BE-SELF)
(asserts! (> value u0) ERR-MIN-CONFIRMATION-CANT-BE-ZERO)
(ok (set-min-confirmation-internal value))
)
)

There should be one more asserts! that ensures value is less than or equal 20.

LNow commented

It can be also set up to be greater than current number of owners and result will be the same - permanent contract lock.

Thanks for reported @LNow Thats a nice catch! Fixed

LNow commented

Hey @talhasch! There is still a loophole I mentioned in 2nd comment.
You can change min-confirmation to be greater than current number of safe owners and you'll end up with locked safe.

Yeah thats right! Also min-confirmation has to be checked while removing and owner...

Validations added to guarantee that min-confirmation always equal or lower than owner count.