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

M-06 MitigationConfirmed #83

Open
code423n4 opened this issue Aug 25, 2023 · 1 comment
Open

M-06 MitigationConfirmed #83

code423n4 opened this issue Aug 25, 2023 · 1 comment
Labels
mitigation-confirmed MR-M-06 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@code423n4
Copy link
Contributor

Lines of code

Vulnerability details

Original Issue

M-06 - drawManager CAN BE SET TO A MALICIOUS ADDRESS

Details

In the previous implementation, there was no access control for the PrizePool.setDrawManager. If the drawManager was not initialized in the constructor, anybody was allowed to set the drawManager to an address of their own

Mitigation

The new logic correctly solves the access control issue, now, in the constructor is initialized a deployer which is set to be the caller (the one creating the PrizePool contract), and in the PrizePool.setDrawManager() was added a check to validate that only the deployer was allowed to set the DrawManager.

function setDrawManager(address _drawManager) external {
  if (msg.sender != deployer) {
    revert NotDeployer();
  }
  if (drawManager != address(0)) {
    revert DrawManagerAlreadySet();
  }
  drawManager = _drawManager;

  emit DrawManagerSet(_drawManager);
}

Conclusion

The implemented mitigation solves the original issue.

@c4-judge
Copy link

c4-judge commented Sep 5, 2023

Picodes marked the issue as satisfactory

@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mitigation-confirmed MR-M-06 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

2 participants