convex icon indicating copy to clipboard operation
convex copied to clipboard

Ensure fixed size Account records

Open kroezone opened this issue 5 years ago • 0 comments

There is a potential exploit with Memory Accounting if the Account records are not fixed size:

  1. Execute some setup code such that:
  2. Memory accounting causes at least one Account size to increase
  3. Execute some more code to make the Account size decrease (e.g. a transfer)
  4. Enjoy a memory refund
  5. Sell the memory for a profit
  6. Repeat

Might not be practical (the transaction of triggering the refund of 1-2 bytes may not be economically viable), but still a risk to plug. BEst solution is probably just to make balance and allowance 64-bit

kroezone avatar Aug 27 '20 03:08 kroezone