low

compiler crash du to ASTTokens instantiation

Reward

Total

455.95 USDC

Selected
455.95 USDC
Selected Submission

compiler crash du to ASTTokens instantiation

Severity

Low Risk

Relevant GitHub Links

https://github.com/vyperlang/vyper/blob/3b310d5292c4d1448e673d7b3adb223f9353260e/vyper/ast/annotation.py#L272

Summary

Instantiating the asttokens.ASTTokens class causes the compiler to crash even for a valid contract.

Vulnerability Details

Suppose the following program:

#@version ^0.3.9

import test5 as T

b: public(uint256)

event Transfer:
    random: indexed(uint256)
    shi: uint256

@external
def transfer():
   log Transfer(T(self).b(), 10)
   return

Compiling it causes the following error:

IndexError: list index out of range

The crash happens after executing the line: https://github.com/vyperlang/vyper/blob/3b310d5292c4d1448e673d7b3adb223f9353260e/vyper/ast/annotation.py#L272

Impact

A valid program can't be compiled.

Tools Used

Manual testing.

Recommendations

We don't know what is the true cause of the crash and thus can't provide recommendation.