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

Ether may be permanently locked if a call to refund address fails #81

Closed
c4-bot-2 opened this issue Jan 21, 2024 · 3 comments
Closed

Ether may be permanently locked if a call to refund address fails #81

c4-bot-2 opened this issue Jan 21, 2024 · 3 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 duplicate-25 insufficient quality report This report is not of sufficient quality unsatisfactory does not satisfy C4 submission criteria; not eligible for awards

Comments

@c4-bot-2
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2024-01-decent/blob/main/src/UTBExecutor.sol#L54

Vulnerability details

Impact

Users may lose Ether in the event of both action execution and refund call failure in the UTBExecutor.sol::execute function. While it is assumed that users must supply their own address as refund, there are no safety checks to verify that refund is indeed an Externally Owned Account (EOA). As a consequence of a refund.call failure, the Ether amount will remain in the UTBExecutor.sol contract with no option for users to claim these funds thus Ether amount becomes permanently locked in the contract.

Proof of Concept

if (token == address(0)) {
    (success, ) = target.call{value: amount}(payload);
    if (!success) {
        (refund.call{value: amount}(""));   // <== funds stay locked in the contract!!!
    }
    return;
}

Tools Used

Manual review

Recommended Mitigation Steps

Consider adding an access-controlled withdrawEth function.

Assessed type

call/delegatecall

@c4-bot-2 c4-bot-2 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 Jan 21, 2024
c4-bot-5 added a commit that referenced this issue Jan 21, 2024
@c4-pre-sort
Copy link

raymondfam marked the issue as insufficient quality report

@c4-pre-sort c4-pre-sort added the insufficient quality report This report is not of sufficient quality label Jan 24, 2024
@c4-pre-sort
Copy link

raymondfam marked the issue as duplicate of #25

@c4-judge c4-judge added the unsatisfactory does not satisfy C4 submission criteria; not eligible for awards label Feb 2, 2024
@c4-judge
Copy link

c4-judge commented Feb 2, 2024

alex-ppg marked the issue as unsatisfactory:
Invalid

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 duplicate-25 insufficient quality report This report is not of sufficient quality unsatisfactory does not satisfy C4 submission criteria; not eligible for awards
Projects
None yet
Development

No branches or pull requests

3 participants