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

User may be front-run when trying to deploy MIMOProxy #148

Open
code423n4 opened this issue Aug 7, 2022 · 2 comments
Open

User may be front-run when trying to deploy MIMOProxy #148

code423n4 opened this issue Aug 7, 2022 · 2 comments
Labels
bug Something isn't working disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) old-submission-method QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-08-mimo/blob/eb1a5016b69f72bc1e4fd3600a65e908bd228f13/contracts/proxy/MIMOProxyRegistry.sol#L49-L51

Vulnerability details

Impact

In MIMOProxyRegistry.deployFor() function, anyone can call to deploy for other users. And if the proxy already exists, it will revert instead of returning the existing one.

if (address(currentProxy) != address(0) && currentProxy.owner() == owner) {
  revert CustomErrors.PROXY_ALREADY_EXISTS(owner);
}

Attacker can front-run users when users try to deploy proxy, make the transaction of users revert. Users still get their proxy but it shows transaction reverted on UI, block explorer,... and affect user experience.

Proof of Concept

Consider the scenario

  1. Alice called MIMOProxyRegistry.deploy() to deploy her own MIMOProxy.
  2. Bob front-run Alice by calling MIMOProxyRegistry.deployFor(address(Alice)) and deploy the proxy for Alice.
  3. Transaction of Alice will be reverted because the proxy already exists. She might be confused and affect her experience. Instead we can simply return the existing one for Alice in her transaction.

Tools Used

Manual Review

Recommended Mitigation Steps

Consider to return the proxy address if it already exists in MIMOProxyRegistry.deployFor()

if (address(currentProxy) != address(0) && currentProxy.owner() == owner) {
  return currentProxy;
}
@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 old-submission-method labels Aug 7, 2022
code423n4 added a commit that referenced this issue Aug 7, 2022
@horsefacts
Copy link

Agree with the narrow finding here, defer on the severity.

@RayXpub
Copy link
Collaborator

RayXpub commented Aug 10, 2022

This is more of a UI problem as mentioned, there is no risk of loss for the user and no incentive for an attacker to do so, thus we consider that this issue should be downgraded to QA

@RayXpub RayXpub added the disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) label Aug 10, 2022
@gzeoneth gzeoneth added QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax and removed 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value labels Aug 21, 2022
@gzeoneth gzeoneth reopened this Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working disagree with severity Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments) old-submission-method QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

4 participants