Abracadabra Mimswap - ravikiranweb3's results

General Information

Platform: Code4rena

Start Date: 07/03/2024

Pot Size: $63,000 USDC

Total HM: 20

Participants: 36

Period: 5 days

Judge: cccz

Total Solo HM: 11

Id: 349

League: BLAST

Abracadabra Money

Findings Distribution

Researcher Performance

Rank: 36/36

Findings: 1

Award: $15.33

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

15.328 USDC - $15.33

Labels

bug
downgraded by judge
grade-b
QA (Quality Assurance)
:robot:_59_group
duplicate-60
Q-21

External Links

Lines of code

https://github.com/code-423n4/2024-03-abracadabra-money/blob/1f4693fdbf33e9ad28132643e2d6f7635834c6c6/src/staking/LockingMultiRewards.sol#L324-L332

Vulnerability details

Impact

recover() enables the owner to withdraw the token balance in the contract to any address of their discretion.

This opens a possibility of vulnerability where the owner can withdraw the token balance deposited in the contract. This is completely at the discretion of the owner to exercise this power and do a rug pull.

Proof of Concept

function recover(address tokenAddress, uint256 tokenAmount) external onlyOwner {
        // In case it's the staking token, allow to skim the excess
        if (tokenAddress == stakingToken && tokenAmount > stakingToken.balanceOf(address(this)) - stakingTokenBalance) {
            revert ErrSkimmingTooMuch();
        }

        tokenAddress.safeTransfer(owner, tokenAmount);
        emit LogRecovered(tokenAddress, tokenAmount);
    }

Tools Used

Manual Review

If the purpose of this function is to skim the excess, dont take the token amount as parameter, instead implement a logic to compute the excess and allow skim and withdraw only the excess amount.

Assessed type

Rug-Pull

#0 - c4-pre-sort

2024-03-15T12:29:27Z

141345 marked the issue as duplicate of #60

#1 - c4-judge

2024-03-29T15:56:49Z

thereksfour changed the severity to QA (Quality Assurance)

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter