Users can grief reward distribution
A smart contract function that adds rewards to an epoch requires that the new epoch be later than the last recorded epoch, preventing backdating. An attacker can front-run a legitimate transaction that tries to add a reward to a past epoch by calling the same function with a tiny amount for a later epoch, causing the legitimate transaction to revert.
Submitted by IllIllI
Users can grief reward distributions by spending dust.
Proof of Concept
If a reward is targeted for an epoch in the past, a user can front-run the txn in the mempool and call addRewardToEpoch() with a dust amount at an epoch after the one in question. This will cause the transaction in the mempool to revert
File: contracts/ExtraRewardsDistributor.sol #1
74 require(len == 0 || rewardEpochs[_token][len - 1] < _epoch, "Cannot backdate to this epoch");
ExtraRewardsDistributor.sol#L74
Recommended Mitigation Steps
Allow the backdating of rewards, which will cost more gas
0xMaharishi (Aura Finance) acknowledged, but disagreed with severity and commented:
Fair finding; however, this is a peripheral contract and only affects user reward claiming. In the Aura system, rewards are only added to the current epoch so should be fine.
0xMaharishi (Aura Finance) resolved:
All code4rena fixes code-423n4/2022-05-aura#6 code4rena aurafinance/aura-contracts#84
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 contract enforces that new reward epochs must be strictly increasing, so any attempt to add a reward for a past epoch will revert if a later epoch has already been recorded.
Impact
The attacker can cause legitimate reward-adding transactions to fail, griefing the reward distribution process, though the project noted this is a peripheral contract and rewards are normally only added to the current epoch.
What the attacker needed
Attacker can submit transactions to the mempool; a legitimate transaction tries to add a reward for a past…
The fix
The recommended mitigation is to allow backdating of rewards, which will cost more gas; the project resolved the issue with code changes.
How it was found
- A legitimate transaction is in the mempool to add a reward for a past epoch.
- An attacker sees this transaction and front-runs it by calling addRewardToEpoch() with a dust amount for a later epoch.
- The legitimate transaction then reverts because the last recorded epoch is now later than the one it tries to add.
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.
This is about a smart contract that distributes rewards over time periods called epochs. The contract has a rule that you cannot add a reward for an epoch that is earlier than the last one you added. An attacker can exploit this by quickly submitting a tiny reward for a later epoch before someone else's transaction that tries to add a reward for an earlier epoch, making that transaction fail.
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.