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

Infinite recursive invocation of contract without deducting gas. #223

Open
jakerr opened this issue Sep 15, 2019 · 1 comment
Open

Infinite recursive invocation of contract without deducting gas. #223

jakerr opened this issue Sep 15, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jakerr
Copy link

jakerr commented Sep 15, 2019

I modified the recursive invocation example so that instead of starting the bomb by explicitly calling the bomb function on the contract, it's kicked off in on_money_received. To set up the bomb first set_own_id is called to allow the contract to store the id for recursive invocation.

gist Here

I expected this to behave like the example, expending all of the senders account PERLS in gas fees; though this would be even more nefarious because it's kicked off from a simple pay [address] [ammount] call.

Actual behavior: The contract is recursively invoked as expected but the gas is never deducted from the caller (see the logs in the gist above).

I'm not sure what the desired behavior here is; maybe the gas not being deducted is a feature to protect senders from this kind of attack? Will this terminate eventually when some max recursion limit is hit? I left it running on my local test net for about 5 minutes with no end in sight.

@iwasaki-kenta iwasaki-kenta self-assigned this Sep 15, 2019
@iwasaki-kenta iwasaki-kenta added the bug Something isn't working label Sep 15, 2019
@iwasaki-kenta
Copy link
Contributor

Will be looking over this over the next week; what you've reported definitely seems to be unintended behavior (the gas should be counted, and sender should be deducted PERLs as gas fees).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants