Closed mhoste51 closed 1 day ago
Thanks a lot for filing this! We've solved it at https://github.com/lambdaclass/lambda_ethereum_rust/issues/1110.
running 1 test
test test_overflow_mcopy ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 134 filtered out; finished in 0.00s
Our team at FuzzingLabs discovered a bug in the op_mcopy function, this bug can lead to a panic when calculating
words_copied
.Root cause
let words_copied = (size + WORD_SIZE - 1) / WORD_SIZE;
We can controlsize
and give a value equal tousize::MAX
. SinceWORD_SIZE = 32
, when we attempt to addusize::MAX + 32
, we encounter an overflow becausewords_copied
is also ausize
.Step to reproduce
Payload
Add to test :
Backtrace