0LNetworkCommunity / libra-legacy-v6

Apache License 2.0
249 stars 116 forks source link

[Tests] Add tests and documentation to show the get_successors bug was not affecting 0L #1259

Open 0o-de-lally opened 1 year ago

0o-de-lally commented 1 year ago

TLDR: 0L was not affected by the critical vulnerability in the Move Language Bytecode::get_successors. No action is needed by 0L validators as of May 15 2023. This pull request adds tests and comments to show where the exploit was taking place, and that 0L did not have that bug introduced in the relevant code.

For historical purposes:

In October 2022 there was a bug introduced in the Move Language which intended to fix an off-by-one error, and instead introduced an early return which caused certain verifications by the VM to be ignored. The commit was: https://github.com/move-language/move/commit/8bddbe65e4a2a9fac64e444d6dc63b521872a14c. This would allow certain scripts to maliciously attack contracts with structs that did not drop (i.e. "hot potato" scenarios). The bug was discovered by Zellic.

A fix was silently applied to all the chains which were affected. 0L was not affected. The relevant fixes were published here: https://github.com/move-language/move/pull/1029/commits/1fa4ed20daaef28b47fe2c5a8d8f63b64523e16d

For completeness of the git archive, we are including comments and up-to-date tests that have been published since the vulnerability was disclosed.