TokenFactory::deployToken does not validate if a token with the same symbol was already deployed, overwriting existing deployed tokens.
Deployed token address in TokenFactory::deployToken is stored in a mapping, with the symbol as key, which is passed as a function parameter. The vulnerability exists when the owner tries to create another token with the same symbol as a previously deployed token, causing the token address to be overwritten. The contract does not validate if a token with the same symbol already exists before deploying a new one, so calling TokenFactory::getTokenAddressFromSymbol will always return the last token deployed with that symbol.
Low, as the function TokenFactory::getTokenAddressFromSymbol is not really used in crucial parts of the bridge protocol.
Manual Review
Foundry
Consider storing token address using a uint256 as the key of the mapping and not the string. Its not recommended to use strings as keys anyways. The id can be a uint256 that increases by one every time the token is deployed.
Alternatively, if the owner wants to use the symbol as the key of the mapping, consider adding a validation before deploying the token, checking that the mapping has no address stored with that given token symbol.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.