Multi-step campaign overrides are anchored to the original campaign, making later overrides impossible
The overrideCampaign function validates new overrides against the original campaign parameters rather than any previously stored override, so once a campaign has been overridden, later overrides are still constrained by the original start time and duration. This prevents creators from adjusting campaigns in multiple steps and causes transactions to revert with InvalidOverride even when the effective campaign has not yet started.
v2110 Follow with ahahaHard1k, araj and 6 others
Originally disclosed on Code4rena
Submitted by v2110, also found by ahahaHard1k, araj, arturtoros, drdee, kovacs7, peazzycole, phoenixV110, and slavina
Contract: DistributionCreator.sol #L237
overrideCampaign always validates a new override against the original campaign parameters stored in campaignList, not against any previously stored override. As a result, once a campaign has been overridden, any later override is still constrained by the original startTimestamp / duration, not by the latest override.
The override mechanism effectively becomes single-use in many realistic scenarios:
- Suppose a creator:
- Creates a campaign with
startTimestamp = 1000,duration = 3600. - Before the original start, calls
overrideCampaignto move the start to2000and extend duration to7200. - Later, at
block.timestamp = 1500, the creator (or operator) wants to adjust parameters again (e.g., tweak duration or start).
Because the validation is still comparing against the original: block.timestamp > _campaign.startTimestamp (1500 > 1000) is true.
If newCampaign.startTimestamp != _campaign.startTimestamp (e.g., 2000 vs original 1000), the condition: (newCampaign.startTimestamp != _campaign.startTimestamp && block.timestamp > _campaign.startTimestamp) becomes true and the transaction reverts with InvalidOverride.
Even though the effective campaign (in the off-chain engine) hasn’t started yet (new start at 2000), the contract refuses a new override due to the original start being in the past.
This leads to:
- Creators being unable to adjust campaigns in multiple steps.
- Operators seeing a revert even when, from a business perspective, the campaign should still be modifiable.
Given Merkl’s model where campaign creators should have flexible control over their campaigns, this is a meaningful functional break, not just cosmetic.
Recommended mitigation steps
Change overrideCampaign to validate against the effective campaign parameters:
-
When there is an override:
CampaignParameters memory base = campaignOverrides[_campaignId].campaignId == _campaignId ? campaignOverrides[_campaignId] : campaignList[campaignLookup(_campaignId)]; -
Use base for all validation instead of the original
campaignListentry. -
This aligns on-chain constraints with how off-chain logic is expected to interpret campaigns.
View detailed Proof of Concept
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 override validation reads from the original campaignList entry instead of the latest stored override, so the original startTimestamp and duration remain the reference point for every subsequent override.
Impact
Creators and operators cannot adjust campaigns in multiple steps, and overrides may revert even when the effective campaign has not yet started, breaking expected flexible control.
What the attacker needed
Creator or operator role on a campaign; campaign has already been overridden once; original start time is in the past
The fix
overrideCampaign should validate against the effective campaign parameters, using the stored override when one exists and falling back to the original campaignList entry otherwise.
How it was found
- Create a campaign with a start timestamp and duration.
- Before the original start, call overrideCampaign to move the start later and extend the duration.
- Later, before the new start but after the original start, attempt another override to adjust parameters.
- The transaction reverts with InvalidOverride because validation still compares against the original start.
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 lets a campaign creator change a campaign's start time and duration by calling an override function. The bug is that the contract always checks the new values against the very first version of the campaign, not the most recent override. So after one change, a second change can be rejected even though the campaign has not actually started yet.
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.