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

safeTransferFrom arbitrary address #8

Closed
code423n4 opened this issue Jun 15, 2022 · 2 comments
Closed

safeTransferFrom arbitrary address #8

code423n4 opened this issue Jun 15, 2022 · 2 comments
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) invalid This doesn't seem right sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/core/InfinityExchange.sol#L236-L241

Vulnerability details

description

in InfinityExchange.sol, MATCH_EXECUTOR can call the function matchOneToManyOrders()

the function performs safeTransferFrom from makerOrder.signer which is a function parameter

performing safeTransferFrom from an address other than msg.sender is inherently unsafe as funds could be transferred from an arbitrary address

PoC

/2022-06-infinity/contracts/core/InfinityExchange.sol
236:       if (makerOrder.execParams[1] == weth) {
237:         IERC20(weth).safeTransferFrom(makerOrder.signer, address(this), protocolFee + gasCost);
238:       } else {
239:         IERC20(makerOrder.execParams[1]).safeTransferFrom(makerOrder.signer, address(this), protocolFee);
240:         IERC20(weth).safeTransferFrom(makerOrder.signer, address(this), gasCost);
241:       }
@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels Jun 15, 2022
code423n4 added a commit that referenced this issue Jun 15, 2022
@nneverlander
Copy link
Collaborator

Not a bug

@nneverlander nneverlander added disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons labels Jul 5, 2022
@HardlyDifficult
Copy link
Collaborator

The attack here is not clear. Closing as invalid.

@HardlyDifficult HardlyDifficult added the invalid This doesn't seem right label Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) invalid This doesn't seem right sponsor acknowledged Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Projects
None yet
Development

No branches or pull requests

4 participants