Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verify calldata length #1730

Closed
MrChico opened this issue Nov 15, 2019 · 2 comments · Fixed by #2911
Closed

verify calldata length #1730

MrChico opened this issue Nov 15, 2019 · 2 comments · Fixed by #2911
Labels
Easy Pickings Used to denote issues that should be easy to implement enhancement

Comments

@MrChico
Copy link

MrChico commented Nov 15, 2019

Vyper doesn't seem to do any verification of the calldata length currently, which can read to a whole range of problems and unintuitive behaviour. For reference, check out:

Expected behaviour is to REVERT if CALLDATA is smaller than expected

@charles-cooper
Copy link
Member

this is an interesting set of behaviors. this issue is slightly related: #1602.

so if I understand correctly, in some cases where user input is not validated, an address with fewer than 20 bytes could be input into a contract, and then following values will appear shifted in the calldata. as an example with an erc20 transfer, if the user inputs this address

0x12345678901234567890123456789012345678 # 19 bytes

then the calldata could look like

0x12345678901234567890123456789012345678<amount>

it's a bit unclear to me though how to detect that the calldata is smaller than expected. for static data it's pretty clear since the size can only be one value but for dynamic data you could still have this issue.

@jacqueswww jacqueswww added enhancement Easy Pickings Used to denote issues that should be easy to implement labels Dec 9, 2019
@jacqueswww
Copy link
Contributor

Meeting Notes: Implement same checks as solidity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy Pickings Used to denote issues that should be easy to implement enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants