Skip to content
DoS Audit finding Intermediate

Tokens yeild can not be set to claimable.

The contract used an incorrect function signature when calling Blast's configure function, so the call would fail if the contract's token balance exceeded 2. An attacker could donate a tiny amount of ETH to the contract to make the configure call revert, preventing yield from being set to claimable.

hassanshakeel13 Follow

Originally disclosed on Code4rena

Submitted by hassanshakeel13

The enabling of yeild on rebasing tokens can be permanently DOS-ed.

Proof of Concept

Abracadabra uses this signature for the configure function for the rebasing function of WETH and USDB

function configure(YieldMode) external returns (YieldMode);

But the actual signature for this is:

function configure(YieldMode yieldMode) external returns (uint256)

And it returns the balance of caller

https://github.com/blast-io/blast/blob/c39cdf1fa7ef9e0d4eaf64a7a5cf7b3c46c739fd/blast-optimism/packages/contracts-bedrock/src/L2/ERC20Rebasing.sol#L220C2-L226

So if the balance of contract is above 2, this function becomes unusable and can’t configure the yeild to be claimable.

The following function always fails:

https://github.com/code-423n4/2024-03-abracadabra-money/blob/1f4693fdbf33e9ad28132643e2d6f7635834c6c6/src/blast/libraries/BlastYields.sol#L20-L27

This can be exploited by attacker by donating a very little amount of eth to the magicLP, blastOnBoarding and now the blastOnBoarding can’t make yeild claimable when the following function is invoked.

https://github.com/code-423n4/2024-03-abracadabra-money/blob/1f4693fdbf33e9ad28132643e2d6f7635834c6c6/src/blast/BlastOnboarding.sol#L175C14-L183

Recommended Mitigation Steps

Use the correct signature used in blast codebase.

0xCalibur (Abracadabra) confirmed and commented:

This is a valid report. We already fixed it before the audit ended.

The fix is here in IBlast.sol:

https://github.com/Abracadabra-money/abracadabra-money-contracts/commit/12f07da03c0adaff123d7e6c684b757855521d61#diff-8f7d8246c1e6d7928012209792b0b3f0a9684a94a40bd802e2b22e5032db04bc

Also fixed in the BlastMock.sol file.

cccz (Judge) decreased severity to Medium and commented:

Downgrade to M because the problematic function will be called when deployed. An attacker can just exploit it to prevent the contract from being deployed. And if the attacker wants to exploit it after the contract is deployed, since the mode is fixed to YieldMode.CLAIMABLE, it will just return even if it is called again by the Owner.

    function enableTokenClaimable(address token) internal {
        if (IERC20Rebasing(token).getConfiguration(address(this)) == YieldMode.CLAIMABLE) {
            return;
        }

This is the deployment script for blastOnboarding.sol, which shows that setTokenSupported will be called immediately after deployment.

contract BlastOnboardingScript is BaseScript {
    function deploy() public returns (BlastOnboarding onboarding) {
        address owner = toolkit.getAddress(block.chainid, "safe.ops");
        address feeTo = toolkit.getAddress(block.chainid, "safe.ops");
        address blastGovernor = toolkit.getAddress(block.chainid, "blastGovernor");
        address blastTokenRegistry = toolkit.getAddress(block.chainid, "blastTokenRegistry");

        vm.startBroadcast();

        onboarding = BlastOnboarding(
            payable(deploy("Onboarding", "BlastOnboarding.sol:BlastOnboarding", abi.encode(blastTokenRegistry, feeTo, tx.origin)))
        );

        if (!testing()) {
            address usdb = toolkit.getAddress(block.chainid, "usdb");
            address mim = toolkit.getAddress(block.chainid, "mim");
            if (!onboarding.supportedTokens(usdb)) {
                onboarding.setTokenSupported(usdb, true);
            }
            if (!onboarding.supportedTokens(mim)) {
                onboarding.setTokenSupported(mim, true);
            }
            if (onboarding.owner() != owner) {
                onboarding.transferOwnership(owner);
            }
        }

        vm.stopBroadcast();
    }
}

Also, even without the deployment script, I think this is a DOS of M severity and there is no loss of funds because the user cannot deposit tokens until setTokenSupported is called.

Note: For full discussion, see here.


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

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

Likely the contract declared and called the external configure function with an incorrect return type (no return value instead of uint256), causing the call to revert when the contract's balance is above 2.

Impact

An attacker could prevent the contract from configuring yield to be claimable, causing a denial of service for that setup step; the judge noted the impact is limited because the function is called during deployment and the mode is fixed to CLAIMABLE, so no funds are lost.

What the attacker needed

Attacker can send tokens to the contract; contract balance above 2

The fix

The issue was fixed by using the correct function signature in the interface and mock contract.

How it was found

  1. Attacker donates a very small amount of ETH to the magicLP or blastOnBoarding contract.
  2. The contract's balance becomes greater than 2.
  3. When the configure function is invoked, it fails because the incorrect signature expects no return value but the real function returns a uint256.
  4. As a result, yield cannot be set to claimable.

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 tried to call a function on another contract but used the wrong definition of that function. Because the real function returns a number, the call fails if the contract already holds more than a tiny amount of tokens. An attacker can send a small amount of tokens to the contract to trigger this failure and block a setup step.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More from Abracadabra Mimswap

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.