claimFees may end up locking user funds #39
Labels
1 (Low Risk)
Assets are not at risk. State handling, function incorrect as to spec, issues with comments
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
Handle
0xngndev
Vulnerability details
Impact
In the NestedBuybacker contract, the function
claimFees
is set to public, meaning anyone can call that function. The function makes a call tofeeSplitter.releaseToken()
, a function that calculates the amount of fees owed to themsg.sender
, and transfers that amount to themsg.sender
.If user A is a shareholder who is owed fees and calls the
claimFees
function, he would be themsg.sender
ofclaimFees
, but the NestedBuybacker contract would be themsg.sender
of the internal callclaimFees
does tofeeSplitter.releaseToken
, meaning thatfeeSplitter.releaseToken
would transfer tokens to NestedBuybacker instead of transferring them to User A.Furthermore, there's no dust collector or withdraw function in the Nestedbuybacker contract, meaning that if this scenario ever plays out, those funds would be locked.
Recommended Mitigation Steps
An easy solution would be to make
claimFees
and internal function inNestedBuybacker
. If an user wants to withdraw their fees, they can always callreleaseToken
in thefeeSplitter
contract, which is also public.The text was updated successfully, but these errors were encountered: