Open hats-bug-reporter[bot] opened 9 months ago
Hey @reednaa
Here https://github.com/hats-finance/Catalyst-Exchange-0x3026c1ea29bf1280f99b41934b2cb65d053c9db4/issues/13#issuecomment-1908551495 you mentioned that users can prevent themselves using minOutAmt.
But this report shows how even after using a minOutAmt the user still faces fund loss. I believe this report should be considered valid.
It is a specifically a dublicate of https://github.com/hats-finance/Catalyst-Exchange-0x3026c1ea29bf1280f99b41934b2cb65d053c9db4/issues/13#issuecomment-1910731444. The migration is as I mention: Checking if U is larger than a certain number.
Github username: -- Twitter username: -- Submission hash (on-chain): 0x8aa75cf20380cfc2684d2b0075e5b958d23f82826e73202d1dd8f7b349c7b0a6 Severity: high
Description: Description\ The Vault contract contains a
_vaultFee
parameter which can be changed by_feeAdministrator
. The_feeAdministrator
address is chosen by the vault deployer at the time of deployment.Currently the vault implementation allows
_vaultFee
to be upto 100%.https://github.com/catalystdao/catalyst/blob/main/evm/src/CatalystVaultCommon.sol#L347-L351
This exposes a vulnerability by which malicious vault owners can forcefully make users pay more fee than intended (upto 100% of the deposit/swap amount).
The
_vaultFee
is currently used in these functions:Attack Scenario\ An example attack can look like this:
_feeAdministrator
sees this txn in mempool and frontruns it to set fee to 90%.sendAsset
txn gets executed. Here only 10% of user's original amount will be added to vault escrow accounting, the rest 90% will be considered as fee.processPacket
call on ChainB. Here the token transfer will fail as the amount is less than what user originally agreed upon (minOutAmt validation).processPacket
call on ChainA for acknowledgement. Now only 10% amount (escrowed in Step3) gets refunded to user.In this attack user lost 90% of his original funds.
I am aware that catalyst owner can change the
_feeAdministrator
but since the owner will be a Timelock there will always be a delay in this rescue.Due to this issue the security of Catalyst cross chain AMM will be fully dependent upon the mercy and goodwill of vault deployers.
Attachments
Proof of Concept (PoC) File NA
Revised Code File (Optional)
Consider taking a
maxAcceptedFee
as input for thesendAsset
call and if the_vaultFee
is greater than this value then revert.