In BridgeRouterFacet.sol, user has two methods to deposit collateral in the protocol: deposit and depositEth. Both call vault.addZeth() to increase user's balance, which is a function that increases the balance of msg.sender. However, msg.sender is the BridgeRouterFacet.sol, not the user itself, so only the Bridge balance increases.
User want to deposit ETH, stETH or rETH to get balance in the protocol. He calls deposit or depositEth.
deposit:
depositzETH:
In these functions, the line vault.addZeth is supposed to increase the user balance. Look at it's code:
However, the line s.vaultUser[vault][msg.sender].ethEscrowed += amount; is increasing the ethEscrowed of msg.sender, which is the BridgeRouterFacet.sol, so the user will deposit a X amount, but the only address which will get ethEscrowed is BridgeRouterFacet.sol.
Probability: High.
Severity: High .
Impact: High .
Any user that deposit via deposit or depositEth in BridgeRouterFacet.sol lose 100% of funds, so it's a high severity vulnerability.
Manual Review
Add a parameter in addZeth that accepts an address. Then, vault.addZeth should input the user's address and addZeth should not rely anymore in msg.sender.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.