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

Unprotected call to a function sending Ether to an arbitrary address. #619

Closed
c4-submissions opened this issue Nov 8, 2023 · 6 comments
Closed
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 edited-by-warden primary issue Highest quality submission among a set of duplicates unsatisfactory does not satisfy C4 submission criteria; not eligible for awards

Comments

@c4-submissions
Copy link
Contributor

c4-submissions commented Nov 8, 2023

Lines of code

https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/MinterContract.sol#L461
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/MinterContract.sol#L437

Vulnerability details

Impact

If the admin address is controlled by a malicious party, they could drain the entire balance of the contract, which might not be the intended behavior.

Proof of Concept

function emergencyWithdraw() public FunctionAdminRequired(this.emergencyWithdraw.selector) {
    uint balance = address(this).balance;
    address admin = adminsContract.owner();
    (bool success, ) = payable(admin).call{value: balance}("");
    emit Withdraw(msg.sender, success, balance);
}
       (bool success4, ) = payable(tm1).call{value: teamRoyalties1}("");
        (bool success5, ) = payable(tm2).call{value: teamRoyalties2}("");

Tools Used

Manual Review

Recommended Mitigation Steps

Ensure that an arbitrary user cannot withdraw unauthorized fund, by adding additional checks and controls..

Assessed type

Reentrancy

@c4-submissions c4-submissions 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 Nov 8, 2023
c4-submissions added a commit that referenced this issue Nov 8, 2023
@c4-pre-sort
Copy link

141345 marked the issue as duplicate of #478

@c4-judge
Copy link

c4-judge commented Dec 1, 2023

alex-ppg marked the issue as not a duplicate

@c4-judge c4-judge reopened this Dec 1, 2023
@alex-ppg
Copy link

alex-ppg commented Dec 6, 2023

The Warden highlights potential areas of untrusted native fund disbursements, however, they fail to pinpoint why these fund disbursements may misbehave.

@c4-judge c4-judge closed this as completed Dec 6, 2023
@c4-judge
Copy link

c4-judge commented Dec 6, 2023

alex-ppg marked the issue as unsatisfactory:
Insufficient proof

@c4-judge c4-judge added the unsatisfactory does not satisfy C4 submission criteria; not eligible for awards label Dec 6, 2023
@alex-ppg
Copy link

alex-ppg commented Dec 6, 2023

As the Warden has submitted multiple invalid findings, I will group any other invalid findings here without providing additional rationale in compliance with the relevant SC verdict.

@c4-judge c4-judge added the primary issue Highest quality submission among a set of duplicates label Dec 6, 2023
@c4-judge
Copy link

c4-judge commented Dec 6, 2023

alex-ppg marked the issue as primary issue

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 edited-by-warden primary issue Highest quality submission among a set of duplicates unsatisfactory does not satisfy C4 submission criteria; not eligible for awards
Projects
None yet
Development

No branches or pull requests

5 participants