IndexTemplate.sol Wrong implementation allows lp of the index pool to resume a locked PayingOut pool and escape the responsibility for the compensation
The resume() function in IndexTemplate.sol lacks proper access control, allowing any user, including liquidity providers, to unlock the index pool during the PayingOut period. A malicious LP could call resume() to escape compensation responsibilities, forcing other LPs to pay more.
Submitted by WatchPug, also found by leastwood
Based on the context, the system intends to lock all the lps during PayingOut period.
However, the current implementation allows anyone, including LPs to call resume() and unlock the index pool.
It allows a malicious LP to escape the responsibility for the compensation, at the expense of other LPs paying more than expected.
function resume() external override {
uint256 _poolLength = poolList.length;
for (uint256 i = 0; i < _poolLength; i++) {
require(
IPoolTemplate(poolList[i]).paused() == false,
"ERROR: POOL_IS_PAUSED"
);
}
locked = false;
emit Resumed();
}
Recommendation
Change to:
function resume() external override {
uint256 _poolLength = poolList.length;
for (uint256 i = 0; i < _poolLength; i++) {
require(
IPoolTemplate(poolList[i]).marketStatus() == MarketStatus.Trading,
"ERROR: POOL_IS_PAYINGOUT"
);
}
locked = false;
emit Resumed();
}
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
Impact
A malicious LP could escape compensation responsibility, causing other LPs to pay more than expected.
What the attacker needed
None
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.
In a smart contract, a function called resume() is supposed to be restricted so that only certain people can call it. Here, anyone can call it, which means a liquidity provider (someone who puts money into the pool) can unlock the pool early and avoid paying their share of compensation. This makes other liquidity providers pay more than they should.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.