Описание
Vyper vulnerable to OOB DynArray access when array is on both LHS and RHS of an assignment
Impact
during codegen, the length word of a dynarray is written before the data, which can result in OOB array access in the case where the dynarray is on both the lhs and rhs of an assignment. here is a minimal example producing the issue:
and here is an example demonstrating the issue can cause data corruption across call frames:
examples involving append and pop:
the expected behavior in all of the above cases is to revert due to oob array access.
Patches
patched in 4f8289a81206f767df1900ac48f485d90fc87edb
Workarounds
Is there a way for users to fix or remediate the vulnerability without upgrading?
References
Are there any links users can visit to find out more?
Пакеты
vyper
< 0.3.8
0.3.8
Связанные уязвимости
Vyper is a Pythonic smart contract language for the Ethereum virtual machine. Prior to version 0.3.8, during codegen, the length word of a dynarray is written before the data, which can result in out-of-bounds array access in the case where the dynarray is on both the lhs and rhs of an assignment. The issue can cause data corruption across call frames. The expected behavior is to revert due to out-of-bounds array access. Version 0.3.8 contains a patch for this issue.