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
KUMASwap incorrectly reverts when when _maxCoupons has been reached #10
if (_coupons.length() == _maxCoupons) {
revert Errors.MAX_COUPONS_REACHED();
}
The above lines will cause ALL bonds sales to revert when _coupons.length has reached _maxCoupons. Since bonds may share the same coupon, the swap should continue to accept bonds with a coupon that already exist in the _coupons set.
Tools Used
Manual Review
Recommended Mitigation Steps
sellBond should only revert if the max length has been reached and bond.coupon doesn't already exist:
- if (_coupons.length() == _maxCoupons) {
+ if (_coupons.length() == _maxCoupons && !_coupons.contains(bond.coupon)) {
revert Errors.MAX_COUPONS_REACHED();
}
The warden has shown a way in which the system could stop selling coupons due to the handling of duplicate coupons, this relies on a specific condition which may not always happen, for this reason, in lack of an attack that can be used to break the functionality, I agree with Medium Severity
Activity
0x52 issue #10
c4-sponsor commentedon Feb 28, 2023
m19 marked the issue as sponsor confirmed
m19 commentedon Feb 28, 2023
Even though this scenario is unlikely to ever happen we have confirmed this issue in a test:
We intend to fix this.
GalloDaSballo commentedon Mar 1, 2023
The warden has shown a way in which the system could stop selling coupons due to the handling of duplicate coupons, this relies on a specific condition which may not always happen, for this reason, in lack of an attack that can be used to break the functionality, I agree with Medium Severity
c4-judge commentedon Mar 1, 2023
GalloDaSballo marked the issue as selected for report