during _buyBack in _feeDispersal in _defiSwap the swapper role is forwarding msg.value although it should be the balance of the contract, leading to loss of funds to swapper role or txn reverts
Root Cause
doing msg.value instead of this.balance
Internal pre-conditions
There is fees need to be dispersed
External pre-conditions
None
Attack Path
User doing a defiswap
Fees paid are paid by the swapper role not the funds of user AmirX
Remainer of funds are sent to safe
Leading to swapper role paying for defiswaps fees which is not intended
Hunter
High
Swapper Role will lose funds due to flowed logic
Summary
during
_buyBack
in_feeDispersal
in_defiSwap
the swapper role is forwardingmsg.value
although it should be the balance of the contract, leading to loss of funds to swapper role or txn revertsRoot Cause
doing
msg.value
instead ofthis.balance
Internal pre-conditions
There is fees need to be dispersed
External pre-conditions
None
Attack Path
User doing a defiswap
Fees paid are paid by the swapper role not the funds of user AmirX
Remainer of funds are sent to
safe
Leading to swapper role paying for defiswaps fees which is not intended
Impact
loss of funds for swapper role
PoC
in Line 233 is the mistake
Mitigation
do
address(this).balance