Submitted by 0xRajeev, also found by cmichel and pauliax
The addLiquidity() function takes a router address parameter, whose liquidity is increased (instead of assuming that router == msg.sender like is done on removeLiquidity()) on this contract/chain, by transferring the fund amount from router address to this contract if assetID != 0 (i.e. ERC20 tokens). However, anyone can call this function on the routers behalf. For assetID == 0, the Ether transfer via msg.value comes from msg.sender and hence is assumed to be the router itself.
The impact is that this will allow anyone to call this function and arbitrarily move ERC20 tokens from router address to this contract, assuming router has given max approval to this contract and has assetID amount available for transfer. While the router can always remove the liquidity if it doesnt want to maintain that level of liquidity, this lack of access control or flexibility for a relayer to add liquidity on routers behalf, may unnecessarily (and without authorization) increase the routers exposure to protocol risk to more than it desires. See TransactionManager.sol #L88-L98. See also, use of msg.sender in removeLiquidity (#L88-L98).
Recommend considering the use of msg.sender in addLiquidity() or evaluate this risk otherwise.
LayneHaber (Connext) acknowledged:
ghoul-sol (Judge) commented:
