Submitted by Czar102, also found by gellej, cmichel, tqts, gzeon, TomFrenchBlockchain, pauliax, and pedroais
TokenSaleUpgradeable.sol#L299-L309
TokenSaleUpgradeable.sol#L311-L324
TokenSaleUpgradeable.sol#L211-L224
Owner is in full control over the saleRecipient address. When a buy() transaction enters the mempool, an owner can frontrun the buy with a transaction that calls setTokenOutPrice() and sets the price to a very high value, effectively making bought tokens close to (if not usually equal) zero and consuming the tokens to the owner-selected address - saleRecipient. Thus, an owner has incentive to perform such attack as they may cause little or zero additional indebtnees to the contract and all tokens to the owner.
This can also be seen as a coincidence - an owner sets a price while a user broadcasts a buy() transaction. The user may buy for a significantly different price than they intended.
Do not let changing sale price after the sale has started. Do not let changing sale start if the sale has already started.
GalloDaSballo (BadgerDAO) disagreed with severity and commented:
0xleastwood (judge) decreased severity to Medium and commented:
0xleastwood (judge) commented:
For this contest, 24 reports were submitted by wardens detailing low risk and non-critical issues. The report highlighted below by warden Czar102 received the top score from the judge.
The following wardens also submitted reports: 0x0x0x, gellej, cmichel, Dravee, 0x1f8b, hubble, OriDabush, pauliax, IllIllI, sirhashalot, NoamYakov, tqts, WatchPug, hyh, Ruhum, floppydisk, csanuragjain, defsec, gzeon, samruna, wuwe1, robee, and kenta.
