Submitted by waydou, also found by 0xb0k0, Decap, robertodf99, Autosaida, 0x3b, Tomas0707 (1, 2), _karanel, Trooper, rndquu, D_Auditor, MKVsentry, samuraii77, unnamed, yaioxy, ogKapten, anonymousjoe, peanuts, y4y, LeFy, MrValioBg, shikhar229169 (1, 2), artilugio0, Phoenix_x, 0xR360, cryptomoon, Coinymous, pfapostol, 0xPwned, Yunaci, Nihavent, 3n0ch, Xcrypt, Quaternion2691, perseus, Udsen, LonelyWolfDemon, den-sosnowsky, Shahil_Hussain, nnez, Zac, ke1caM, shaka, 4rdiii, and Kalogerone
The current implementation of the EntropyGenerator contract allows for the possibility of having two Golden God tokens (tokens with an entropy value of 999999) per generation. This duplicity undermines the intended uniqueness and rarity of the Golden God token, potentially disrupting the games economy and fairness. The predictability of one Golden God token, combined with the chance of a second one, could lead to exploitation and loss of player trust.
The vulnerability stems from two separate mechanisms that can produce a Golden God token:
The predetermined Golden God is set during initialization, and the other Golden God token is set in the writeEntropyBatch3. Since the math in the getEntropy doesnt affect 6 figure digits, this means if writeEntropyBatch3 does write a slot with golden number 999999; its only a matter of time before someone gets since the nfts are attributed the slot sequentially. (Token 1 will get slotIndex and numberIndex [0,0], token 2 will get [0,1], token 3 will get [0,2], and so on).
Add a boolean to check if a golden god token has already been issued.
Context
TForge1 (TraitForge) acknowledged and commented:
Koolex (judge) decreased severity to Medium and commented:
Abdessamed (warden) commented:
Koolex (judge) commented:
Abdessamed (warden) commented:
Note: For full discussion, see here.
