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

fix(protocol): oz - use excessivelySafeCall instadd of to.call(...) #16145

Merged
merged 3 commits into from
Feb 28, 2024

Conversation

dantaik
Copy link
Contributor

@dantaik dantaik commented Feb 28, 2024

Even when a gas limit is set for an external call, the external contract can force the transaction to use gas in excess of the specified limit due to an open issue with the Solidity compiler. This is possible because the calling contract pays for memory expansion to accommodate the return data, but the called contract controls the size of that return data.
The external call on line 41 in the LibAddress.sol could be attacked with a return bomb.
Consider using assembly to explicitly limit the amount of memory allocated for the return data from the external call.

@dantaik dantaik marked this pull request as ready for review February 28, 2024 02:28
@dantaik dantaik changed the title fix(protocol): use excessivelySafeCall instadd of to.call(...) fix(protocol): oz - use excessivelySafeCall instadd of to.call(...) Feb 28, 2024
@dantaik dantaik added this pull request to the merge queue Feb 28, 2024
Merged via the queue into main with commit 8d79dde Feb 28, 2024
8 checks passed
@dantaik dantaik deleted the External-Call-Could-Be-a-Return-Bomb-Vector branch February 28, 2024 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants