external call

Slow Fog: Transit Swap was hacked due to arbitrary external calls, and 2500 BNB has been transferred to Tornado Cash

According to ChainCatcher news and intelligence from the SlowMist security team, the cross-chain DEX aggregator Transit Swap project was attacked, resulting in unexpected transfers of user assets. The SlowMist security team analyzed and assessed that the scale of the stolen funds exceeds $23 million, with hacker addresses being 0x75F2...FD46 and 0xfa71...90fb. The analysis of the attack process is as follows:When users perform a swap on Transit Swap, they first select different routing bridge contracts through the routing proxy contract (0x8785bb...) based on different exchange types. Subsequently, the routing bridge contract (0x0B4727...) transfers the tokens to be exchanged into the routing bridge contract through the claimTokens function of the permission management contract (0xeD1afC...). Therefore, users need to authorize the permission management contract (0xeD1afC...) before token exchange.The claimTokens function transfers tokens by calling the transferFrom function of the specified token contract. The parameters received are passed in by the upper routing bridge contract (0x0B4727...), which does not impose any restrictions on these parameters and only checks that the caller must be the routing proxy contract or the routing bridge contract.After receiving the tokens to be exchanged from the user, the routing bridge contract (0x0B4727...) calls the exchange contract to perform the specific exchange operation, but the address of the exchange contract and the specific function call data are passed in by the upper routing proxy contract (0x8785bb...), and the routing bridge contract does not check the parsed exchange contract address and call data.The parameters passed to the routing bridge contract (0x0B4727...) by the proxy contract (0x8785bb...) also come from the parameters provided by the user. The proxy contract (0x8785bb...) only ensures that the lengths of the data in the user-provided calldata meet expectations and that the called routing bridge contract is an address in the whitelist mapping, without performing specific checks on the calldata data.Therefore, the attacker exploited the flaws in the routing proxy contract, routing bridge contract, and permission management contract, which did not check the incoming data. By passing in constructed data through the routing proxy contract to call the callBytes function of the routing bridge contract. The callBytes function parses the exchange contract and exchange data specified by the attacker, at which point the exchange contract is designated as the permission management contract address, and the exchange data is specified to call the claimTokens function to transfer the specified user's tokens to the address designated by the attacker. This resulted in the theft of all tokens from users who authorized the permission management contract.The main reason for this attack lies in the fact that the Transit Swap protocol did not strictly check the data provided by users during token exchanges, leading to arbitrary external call issues. The attacker exploited this arbitrary external call issue to steal the tokens authorized by users to Transit Swap.As of now, the hacker has transferred 2,500 BNB to Tornado Cash, with the remaining funds dispersed and retained in the hacker's addresses. Analysis of the hacker's traces revealed that the hacker has withdrawn and deposited from platforms such as LATOKEN. SlowMist MistTrack will continue to follow up on the transfer of the stolen funds and the analysis of the hacker's traces. (Source link)
ChainCatcher Building the Web3 world with innovators