Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Passing lambda into Balance_of entry point can be exploited to spoof a receiver #15

Closed
emishur opened this issue Nov 5, 2019 · 0 comments

Comments

@emishur
Copy link
Collaborator

emishur commented Nov 5, 2019

From Tom Jack:
"now, here's my impersonation example: I call the erc1155 Balance_of_batch method. I pass a lambda which generates a On_erc1155_batch_received transfer to the victim erc1155_token_receiver the erc1155 thinks this is an innocent "view" operation, but it is not"

"the correct way is for the caller of Balance_of_batch to pass a (balance_request * nat list)contract instead of the lambda, and for the erc1155 to (carefully) construct the TRANSFER_TOKENS (or perhaps address instead of contract, unclear).

this is still somewhat tricky, you need to ensure that the type (balance_request * nat list) cannot be used for "impersonation"

e.g. is incompatible with the types for On_erc1155_batch_received"

┆Created By: tqbot

@emishur emishur closed this as completed Nov 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant