Submitted by p_crypt0, also found by CertoraInc
No checks for non-Cudos tokens mean that non-Cudos ERC20 tokens will be lost to the contract, with the user not having any chance of retrieving them.
However, the admin can retrieve them through withdrawERC20.
Impact is that users lose their funds, but admins gain them.
The mistakes could be mitigated on the contract, by checking against a list of supported tokens, so that users dont get the bad experience of losing funds and CUDOS doesnt have to manually refund users
User sends 100 ETH through sendToCosmos, hoping to retrieve 100 synthetic ETH on Cudos chain but finds that funds never appear.
Gravity.sol#L595-L609
Admin can retrieve these funds should they wish, but user never gets them back because the contract does not check whether the token is supported.
Gravity.sol#L632-L638
Logic and discussion with @germanimp (Cudos)
Add checks in sendToCosmos to check the incoming tokenAddress against a supported token list, so that user funds dont get lost and admin dont need to bother refunding.
mlukanova (Cudos) confirmed
V-Staykov (Cudos) resolved and commented:
Note: there were originally 7 items judged as Medium severity. After judging was finalized, further input from the sponsor was provided to the judge for reconsideration. Ultimately, the judge decreased issue #143 to non-critical.
For this contest, 41 reports were submitted by wardens detailing low risk and non-critical issues. The report highlighted below by IllIllI received the top score from the judge.
The following wardens also submitted reports: 0x1337, jayjonah8, GimelSec, dirk_y, GermanKuber, CertoraInc, ch13fd357r0y3r, kirk-baird, MaratCerby, gzeon, dipp, robee, 0xkatana, Hawkeye, sorrynotsorry, orion, hubble, jah, defsec, Waze, ilan, m9800, hake, shenwilly, AmitN, danb, Dravee, cccz, cryptphi, 0x1f8b, broccolirob, ellahi, Funen, 0xDjango, WatchPug, kebabsec, simon135, JC, oyc_109, and delfin454000.
