Submitted by Arz
Ecosystem tokens are tokens that dont have an underlying token address in any branch and only the global representation exists. The governance adds them by calling addEcosystemToken() where the _ecoTokenGlobalAddress will be the Maia or Hermes token, as the sponsor mentioned, or any other tokens that could be added in the future.
The problem is that anyone can create a hToken where the underlying asset is the ecosystem token and then this mapping will get updated in setAddresses():
https://github.com/code-423n4/2023-09-maia/blob/f5ba4de628836b2a29f9b5fff59499690008c463/src/RootPort.sol#L252
The _underlyingAddress equals to the _ecoTokenGlobalAddress and when the admin calls addEcosystemToken(), it will then revert because of this check that is incorrect:
https://github.com/code-423n4/2023-09-maia/blob/f5ba4de628836b2a29f9b5fff59499690008c463/src/RootPort.sol#L493
getLocalTokenFromUnderlying[_ecoTokenGlobalAddress] will not be a zero address because it was set when the attacker added the hToken.
The check here is redundant. Even if someone creates a hToken where the underlying asset will be the ecosystem token, it will not be tied to the ecosystem token in any way, as it has a different global address and a different local address.
The governance will fail to add the ecosystem tokens. They will not work with this part of Ulysses because an attacker can easily create a hToken before the ecosystem token is set.
Add this to RootTest.t.sol
As you can see here, the tx reverts because of that check and the admin will fail to add the ecosystem token.
Foundry
Remove this check as its redundant, as setting the ecosystem tokens when initializing is not the best solution because other tokens can be added in the future.
DoS
0xBugsy (Maia) disputed and commented:
alcueca (judge) commented:
0xLightt (Maia) commented:
alcueca (judge) commented:
0xLightt (Maia) confirmed, but disagreed with severity and commented:
0xBugsy (Maia) commented:
Note: For full discussion, see here.
