Caller of Upkeep may skip step 11 to save gas
The upkeep function runs multiple steps in try/catch blocks, and a caller can supply just enough gas to complete steps 1–10 but not step 11, so step 11 reverts and is caught while the caller still receives the 5% incentive. This lets the caller save gas and skip sending SALT from the team vesting wallet to the team.
Originally disclosed on Code4rena
Submitted by handsomegiraffe
In Upkeep.sol, performUpkeep() is expected to be called by anyone who wishes to earn the 5% incentive. The function runs through steps 1 to 11, each wrapped in a try/catch block to prevent reversions from blocking the entire function.
A dishonest user may call performUpkeep but provide only sufficient gas for steps 1 to 10. Step 11 would revert and the user still receives the incentive for performing the upkeep.
This attack is possible due to the EIP150 rule where 63/64 of gas is forwarded to an external call. If insufficient gas is sent to complete step 11, the remaining 1/64 gas could still be sufficient to emit the error and continue without reverting.
try this.step11() {}
catch (bytes memory error) { emit UpkeepError("Step 11", error); }
Impact
The user benefits from gas saved by not having to run step 11. Step 11 sends SALT from the team vesting wallet to the team; skipping this step this could cause issues for the team by not receiving expected SALT at each upkeep.
Recommended Mitigation Steps
Check that sufficient gas is sent at the start of the function call.
othernet-global (Salty.IO) acknowledged
This report shows how a user could potentially be rewarded and not execute the tasks correctly, so would essentially steal funds from the DAO.
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 function does not verify that enough gas was provided to complete all steps, and the try/catch around step 11 allows it to fail without reverting the whole transaction.
Impact
The caller saves gas by skipping step 11, and the team may not receive the expected SALT from the vesting wallet at each upkeep.
What the attacker needed
Ability to call performUpkeep; control over gas sent with the transaction
The fix
The function should check that sufficient gas is sent at the start of the call.
How it was found
- Call performUpkeep with only enough gas to complete steps 1 to 10.
- Step 11 reverts due to insufficient gas, but the error is caught and the function continues.
- The caller still receives the 5% incentive.
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 has a function that anyone can call to earn a reward. That function does several jobs in order, and each job is wrapped so that if one fails, the rest still run. The problem is that the caller can send just enough gas to finish the first ten jobs but not the eleventh, so the eleventh fails silently and the caller still gets paid.
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.