The L1ECOBridge contract stores an inflationMultiplier that is only updated when a separate rebase function is called; if rebase is delayed, the stored multiplier becomes stale relative to the L1 ECO token's actual inflation multiplier. An attacker can deposit tokens while the stale multiplier is larger than the current one, causing the bridge to record an inflated gons amount and receive more tokens on L2 than deserved.
L1ECOBridge::inflationMultiplier is updated through L1ECOBridge::rebase on Ethereum, and it is used in _initiateERC20Deposit and finalizeERC20Withdrawal to convert between token amount and _gonsAmount. However, if rebase is not called in a timely manner, the inflationMultiplier value can be stale and inconsistent with the value of L1 ECO token during transfer, leading to incorrect token amounts in deposit and withdraw.
Vulnerability Detail
The inflationMultiplier value is updated in rebase with an independent transaction on L1 as shown below:
Solidity
function rebase(uint32 _l2Gas) external {
inflationMultiplier = IECO(l1Eco).getPastLinearInflation(block.number);
However, in both _initiateERC20Deposit, transferFrom is called before the inflationMultiplier is used, which can lead to inconsistent results if rebase is not called on time for the inflationMultiplier to be updated. The code snippet for _initiateERC20Deposit is as follows:
Calling IECO(l1Eco).getPastLinearInflation(block.number) instead of using inflationMultiplier.
Discussion
syjcnss
Escalate for 10 USDC.
This is different from #52 which is about desynced inflationMultiplier between L1&L2 bridges.
#17, #83, #110 and #126 are about desynced inflationMultiplier between the L1ECOBridge and the L1 ECO token.
In L1, the actually transfered gos amount will be different from the gos amount deposited if the inflationMultiplier is stale and not updated by calling rebase. This has nothing to do with the L2 inflationMultiplier.
Solidity
bridge/L1ECOBridge.sol:_initiateERC20Deposit
IECO(_l1Token).transferFrom(_from, address(this), _amount); // <- transfer underlying gos amount(_amount * 'inflationMultiplier' inside the L1 ECO token) of tokens to deposit
_amount = _amount * inflationMultiplier; // <- record a wrong gos deposited token amount if inflationMultiplier is stale
In the PoC, @albertnbrown proves that a desynced inflationMultiplier between L1&L2 bridges does not cause a problem. The PoC has a synced value between L1ECOBridge and the L1 ECO token at desposit because the constructor initiated inflationMultiplier with IECO(l1Eco).getPastLinearInflation(block.number). So it doesn't invalidate this issue.
sherlock-admin
Escalate for 10 USDC.
This is different from #52 which is about desynced inflationMultiplier between L1&L2 bridges.
#17, #83, #110 and #126 are about desynced inflationMultiplier between the L1ECOBridge and the L1 ECO token.
In L1, the actually transfered gos amount will be different from the gos amount deposited if the inflationMultiplier is stale and not updated by calling rebase. This has nothing to do with the L2 inflationMultiplier.
Solidity
bridge/L1ECOBridge.sol:_initiateERC20Deposit
IECO(_l1Token).transferFrom(_from, address(this), _amount); // <- transfer underlying gos amount(_amount * 'inflationMultiplier' inside the L1 ECO token) of tokens to deposit
_amount = _amount * inflationMultiplier; // <- record a wrong gos deposited token amount if inflationMultiplier is stale
In the PoC, @albertnbrown proves that a desynced inflationMultiplier between L1&L2 bridges does not cause a problem. The PoC has a synced value between L1ECOBridge and the L1 ECO token at desposit because the constructor initiated inflationMultiplier with IECO(l1Eco).getPastLinearInflation(block.number). So it doesn't invalidate this issue.
You've created a valid escalation for 10 USDC!
To remove the escalation from consideration: Delete your comment.
You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.
albertnbrown
This is a legitimate high issue and we found it and addressed it on our own already, but were having trouble looking through the duplicates for #52 for issues like this to correctly reward them. Thanks for escalating it for visibility.
Fixed confirmed. Using the token inflationMultiplier instead of the bridge inflationMultiplier
The original report as published on Sherlock, by 0xRobocop. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Generating the AI write-up for this report.
This usually takes about a minute. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
How it worked
Root cause
Likely the bridge caches the inflationMultiplier in storage and only updates it via a separate rebase transaction, so the cached value can diverge from the token's current multiplier used during transferFrom.
Impact
An attacker could steal tokens by depositing when the stored multiplier is stale and larger, receiving more tokens on L2 than they deposited.
What the attacker needed
Rebase not called recently; attacker can deposit to L1 bridge
The fix
The bridge should read the token's current inflation multiplier directly from the L1 ECO token instead of using the stored value; the report states this was fixed.
How it was found
Observe that the bridge's stored inflationMultiplier is larger than the L1 ECO token's current multiplier because rebase has not been called.
Deposit tokens to the L1 bridge; transferFrom moves the correct gons amount but the bridge multiplies the amount by the stale larger multiplier.
Receive more tokens on L2 than the deposit was worth.
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.
Generating the AI write-up for this report.
This usually takes about a minute. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
A bridge moves tokens between two blockchains. This bridge uses a number called inflationMultiplier to convert between the token's internal units and the amount users see. That number is only refreshed when someone calls a separate function. If nobody calls it for a while, the bridge uses an old number. An attacker can deposit at that moment and the bridge will think they deposited more than they did, so they get extra tokens on the other chain.
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.