-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interchain token transfer can be Dossed Due To Flow Limit #484
Comments
0xSorryNotSorry marked the issue as primary issue |
deanamiel marked the issue as disagree with severity |
Corrected Severity: QA |
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:
|
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
The text was updated successfully, but these errors were encountered: