Skip to content
Business logic Audit finding Beginner

Raffle sol implementation logic allows direct plume transfers but has no withdraw locking funds permanently

The Raffle implementation contract has a receive function that accepts native PLUME, but no way to withdraw it, so any PLUME sent directly to the implementation is permanently locked. The proxy blocks direct transfers, but the implementation does not.

blackgrease Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

49893 sc insight raffle sol implementation logic allows direct plume transfers but has no withdraw locking funds permanently

Summary

The implementation of the Raffle contract can receive native PLUME via its receive function, but it lacks any functionality to withdraw those funds, resulting in permanently locked tokens.

The RaffleProxy correctly blocks direct transfers (reverting with ETHTransferUnsupported()), but the implementation contract does not, so any PLUME sent directly to the implementation will be unretrievable.

Details

Raffle implementation snippet:

Solidity
    //---snip----
    // UUPS Authorization
    function _authorizeUpgrade(
        address newImplementation
    ) internal override onlyRole(ADMIN_ROLE) { }

    // Allow contract to receive ETH
    receive() external payable {
     }

}

Documentation states that the Raffle system is not expected to handle funds because rewards are handled off-chain:

"Claiming a Prize(Multi-Winner aware): ... The actual delivery of the prize is handled off-chain."
Source: https://github.com/plumenetwork/contracts/blob/main/plume/SPIN.md#2-the-raffle-contract-raffle.sol

Because the implementation contract can accept native PLUME and has no withdrawal or forwarding logic, any PLUME transferred directly to the implementation will be permanently locked.

Impact

Permanent locking of funds: any PLUME sent to the implementation contract will be inaccessible, resulting in protocol-held value that cannot be used for operations or recovery.

Mitigation

{% stepper %} {% step %}

Revert direct transfers

Modify the receive function to revert on direct transfers, for example:

Diff
    receive() external payable {
+        revert("Direct Plume Transfer");
    }

{% endstep %}

{% step %}

Remove the receive function

Alternatively, remove the receive function entirely so the implementation cannot accept native PLUME. {% endstep %} {% endstepper %}

Proof of Concept

A runnable PoC demonstrates sending native PLUME to the implementation contract and shows that funds become locked with no withdrawal path.

Gist (PoC): https://gist.github.com/blackgrease/75dcdaf92e9d5482e3e4c4abc30c3d82

Run with:

forge test --mt testCanSendPlumeButNoWithdraw --via-ir -vvv

Walk-through:

  • Sending PLUME to the RaffleProxy reverts as intended.
  • Sending PLUME to the Raffle implementation succeeds (because of the receive function).
  • The implementation has no withdrawal functionality; funds remain locked.
<details> <summary>Additional PoC notes &#x26; artifacts</summary> </details>

The original report as published on Immunefi, by blackgrease. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The implementation contract defines a payable receive function but has no withdrawal or forwarding logic, so native PLUME sent to it cannot be recovered.

Impact

Any PLUME sent directly to the implementation contract is permanently locked and cannot be used for operations or recovery.

What the attacker needed

PLUME sent directly to the implementation contract

The fix

The receive function should be changed to revert on direct transfers, or removed entirely, so the implementation cannot accept native PLUME.

How it was found

  1. Send PLUME to the RaffleProxy; the transfer reverts as intended.
  2. Send PLUME to the Raffle implementation; the transfer succeeds because of the receive function.
  3. Observe that the implementation has no withdrawal functionality, so the funds remain locked.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A smart contract can have a special function that lets it accept cryptocurrency sent to it. This Raffle contract accepts PLUME but has no function to send it back out, so any PLUME sent directly to it is stuck forever. The proxy in front of it correctly rejects direct transfers, but the implementation behind it does not.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by blackgrease

View all

25 more disclosed reports, best first.

More from Plume Network

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.