Submitted by kirk-baird
Swivel lend() does not validate the o.exit and o.vault for each order before making the external call to Swivel. These values determine which internal functions is called in Swivel.
The intended code path is initiateZcTokenFillingVaultInitiate() which takes the underlying tokens and mints zcTokens to the Lender. If one of the other functions is called the accounting in lend(). Swivel may transfer more tokens from Lender to Swivel than paid for by the caller of lend().
The impact is that underlying tokens may be stolen from Lender.
Consider the example where initiateZcTokenFillingZcTokenExit() is called. This will transfer a - premiumFilled + fee from Lender to Swivel rather than the expected a + fee.
In lend() restrict the values of o.exit and o.vault so only one case can be triggered in Swivel.initiate().
sourabhmarathe (Illuminate) commented:
JTraversa (Illuminate) confirmed, but disagreed wtih severity and commented:
gzeoneth (judge) decreased severity to Medium and commented:
