AugAssign evaluation order causing OOB write within the object in Vyper
Description
Published by the National Vulnerability Database
Feb 21, 2025
Published to the GitHub Advisory Database
Feb 21, 2025
Reviewed
Feb 21, 2025
Last updated
Feb 24, 2025
Vyper handles AugAssign statements by first caching the target location to avoid double evaluation. However, in the case when target is an access to a DynArray and the rhs modifies the array, the cached target will evaluate first, and the bounds check will not be re-evaluated during the write portion of the statement. In other words, the following code
is equivalent to:
rather than:
References