Submitted by 0xStalin, also found by ladboy233 and hals
Attackers can gain control of Users Virtual Accounts and steal all the assets in these accounts held in the Root environment.
BranchBridgeAgent.sol:
RootBridgeAgent.sol:
RootPort.sol:
Like the example, lets suppose that a user uses a MultiSigWallet contract to deposit tokens from Avax to Root, in the RootBridgeAgent contract. The address of the MultisigWallet will be used to create a Virtual Account, and all the globalTokens that were bridged will be deposited in this Virtual Account.
Now, the problem is that the address of the MultisigWallet, might not be controlled by the same user on a different chain. For example, in Polygon, an attacker could gain control of the address of the same address of the MultisigWallet that was used to deposit tokens from Avax in the Root environment. An attacker can send a signed message from Polygon, using the same address of the MultisigWallet that deposited tokens from Avax, to the Root environment, requesting to withdraw the assets that the Virtual Account is holding in the Root environment to the Polygon Branch.
When the message is processed by the Root environment, the address that will be used to obtain the Virtual Account will be the address that initiated the call in Polygon; which will be the same address of the users MultisigWallet contract who deposited the assets from Avax. However, the Root environment, when fetching the virtual account, makes no distinctions between the branches. Thus, it will give access to the Virtual Account of the attackers caller address and process the message in the Root environment.
As a result, an attacker can gain control of the Virtual Account of an account contract that was used to deposit assets from a chain into Root, by gaining control of the same address of the account contract that deposited the assets in a different chain.
As explained in detail on this article written by Rekt, it is possible to gain control of the same address for contract accounts in a different chain; especially for those contract accounts that are deployed using the Gnosis Safe contracts:

The recommendation is to add some logic that validates if the caller address in the BranchBridgeAgent is a contract account or an EOA. If its a contract account, send a special flag as part of the crosschain message, so that the RootBridgeAgent contract can know if the caller in the SrcBranch its a contract or an EOA.
Make sure to use the srcChainId to validate if the caller is an owner of the Virtual Account.
Access Control
0xLightt (Maia) confirmed:
alcueca (judge) increased severity to High and commented:
alcueca (judge) commented:
Limbooo (warden) commented:
ladboy233 (warden) commented:
alcueca (judge) commented:
0xBugsy (Maia) commented:
