Open code423n4 opened 1 year ago
0xSorryNotSorry marked the issue as primary issue
deanamiel marked the issue as disagree with severity
Corrected Severity: QA This behavior is intentional. If an attacker tries to block one way (either in or out), the operator can respond by increasing the flowLimit (or setting it to 0 meaning there's no limit at all) to help handle the attack. We prefer to keep fees as low as possible, so we would not want to use the Chainlink method that was suggested.
Even though this is intentional, the demonstrated issue can cause temporary availability (inability to transfer tokens) issues for the token service. This qualifies for medium severity, according to the C4 judging criteria:
Assets not at direct risk, but the function of the protocol or its availability could be impacted,
berndartmueller changed the severity to 2 (Med Risk)
berndartmueller marked the issue as selected for report
We consider this QA for the following reasons:
Lines of code
https://github.com/code-423n4/2023-07-axelar/blob/2f9b234bb8222d5fbe934beafede56bfb4522641/contracts/its/token-manager/TokenManager.sol#L83-L173 https://github.com/code-423n4/2023-07-axelar/blob/2f9b234bb8222d5fbe934beafede56bfb4522641/contracts/its/interchain-token/InterchainToken.sol#L1-L106
Vulnerability details
Impact
A large token holder can send back and forth tokens, using the flow limit to the capacity in start of every epoch making the system unusable for everyone else.
Proof of Concept
Interchain tokens can be transferred from one chain to another via the token manager and interchain token service.
And there is a limit imposed, for both the flow out and flow in.
Flow out happens when we send the token from one chain to another. Lets say arbitrum to optimism and we are sending USDC. So in this case, in context of arbitrum it will be flow out and in context of optimism it will be flow in and and receiver on optimism will get the tokens via the token manager 'giveToken()' callable by the inter chain token service.
But there is a flow limit impose per epoch.
One Epoch = 6 hours long.
So there cannot be more than certain amount of tokens sent between the chain per 6 hours. This is done to protect from the uncertain conditions like a security breach and to secure as much of tokens as possible.
But the problem with such design is big token holder or whale could easily exploit it to DOS the other users.
Consider the following scenerio:
This attack is pretty simple and easy to acheive and also very cheap to do, specifically on the L2's or other cheap chains due to low gas price.
Function using the flow limit utility in
tokenManager.sol
are followingTools Used
Manual review
Recommended Mitigation Steps
There could be many solution for this one. But two solutions from top of my head are:
Do the chainlink way CCIP way, chainlink recently launched cross chain service solved the similar problem by imposing the token bps fee, by imposing such fee along with gas fee, cost of attack becomes way higher and system can be protected from such attack.
Introduce the mechanism of limit per account, instead of whole limit. But that can be exploited too by doing it through multiple accounts.
Chainlink's way would be the better solution to go with IMO.
Assessed type
DoS