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

Assets are transferred if the execute call fails #72

Closed
code423n4 opened this issue Jul 12, 2021 · 1 comment
Closed

Assets are transferred if the execute call fails #72

code423n4 opened this issue Jul 12, 2021 · 1 comment
Labels
3 (High Risk) bug Something isn't working duplicate This issue or pull request already exists sponsor confirmed Yes, this is a problem and we intend to fix it.

Comments

@code423n4
Copy link
Contributor

Handle

shw

Vulnerability details

Impact

When the user calls fulfill with a non-zero callTo parameter, the TransactionManager tries to call execute on callTo, and if the function call fails, the manager transfers toSend amount of receiving assets to receivingAddress. However, since the assets may have been transferred before (when the addFunds call fails), the user could get twice the toSend amount assets as a result.

Proof of Concept

Referenced code:
TransactionManager.sol#L405-L408
TransactionManager.sol#L424-L427

Recommended Mitigation Steps

Since the assets are approved or transferred to the receivingAddress before calling the execute function, the manager should not transfer assets again if the execute call fails.

@code423n4 code423n4 added 3 (High Risk) bug Something isn't working labels Jul 12, 2021
code423n4 added a commit that referenced this issue Jul 12, 2021
@LayneHaber LayneHaber added duplicate This issue or pull request already exists sponsor confirmed Yes, this is a problem and we intend to fix it. labels Jul 12, 2021
@LayneHaber
Copy link
Collaborator

#46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 (High Risk) bug Something isn't working duplicate This issue or pull request already exists sponsor confirmed Yes, this is a problem and we intend to fix it.
Projects
None yet
Development

No branches or pull requests

2 participants