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: C-01 Missing Access Control for setDestinationSettler #733

Merged
merged 1 commit into from
Nov 14, 2024
Merged

Conversation

bmzig
Copy link
Contributor

@bmzig bmzig commented Nov 8, 2024

The ERC7683OrderDepositorExternal contract contains the setDestinationSettler function which provides a mapping of chain ID to that chain's settler contract address. This value is accessed through the _destinationSettler function of the same contract and is used by the inherited ERC7683OrderDepositor contract when constructing the fill instructions inside the _resolveFor function.

The issue is that the setDestinationSettler function has no access control and can be changed to any arbitrary address by any account. Consequently, a malicious user could set the destinationSettler address to a malicious address which is used in constructing the fill instructions. The filler on the destinationChain would need to give token approvals to the destinationSettler to execute the fill call. A malicious destinationSettler would be thus able to steal funds from the filler.

Since the ERC7683OrderDepositorExternal contract already inherits the Ownable contract, consider adding the onlyOwner modifier to its setDestinationSettler function.

This applies the suggestion and adds onlyOwner to setDestinationSettler.

Signed-off-by: bennett <bennett@umaproject.org>
@bmzig bmzig marked this pull request as ready for review November 14, 2024 01:31
@bmzig bmzig merged commit 2fc8fbf into master Nov 14, 2024
9 checks passed
@bmzig bmzig deleted the 1124oz/c01 branch November 14, 2024 19:53
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