Denial of service in globalPause by wrong logic
The globalPause function in FraxlendPairDeployer.sol returns an uninitialized array, causing the transaction to fault when called. An attacker with the circuit breaker role could not use it to pause all pairs at once, but the impact is limited because individual pairs can still be paused.
Submitted by 0x1f8b
The method globalPause is not tested and it doesn’t work as expected.
Proof of Concept
Because the method returns an array (_updatedAddresses) and has never been initialized, when you want to set its value, it fails.
Recipe:
- Call
globalPausewith any valid address. - The transaction will FAULT.
Affected source code
Recommended Mitigation Steps
Initialize the _updatedAddresses array like shown below:
function globalPause(address[] memory _addresses) external returns (address[] memory _updatedAddresses) {
require(msg.sender == CIRCUIT_BREAKER_ADDRESS, "Circuit Breaker only");
address _pairAddress;
uint256 _lengthOfArray = _addresses.length;
+ _updatedAddresses = new address[](_lengthOfArray);
for (uint256 i = 0; i < _lengthOfArray; ) {
_pairAddress = _addresses[i];
try IFraxlendPair(_pairAddress).pause() {
_updatedAddresses[i] = _addresses[i];
} catch {}
unchecked {
i = i + 1;
}
}
}
DrakeEvans (Frax) confirmed, but disagreed with severity and commented:
Valid, disagree with severity. This is a convenience function. Pause can still be called on the pairs themselves individually. No user funds at risk, and no users can even touch this function, additionally no loss of functionality in the pairs themselves. Only result is admin having to revert and spin up tx individually.
gititGoro (judge) decreased severity to Medium and commented:
Well caught! But definitely a Medium severity, given the existence of per pair pausing.
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
The globalPause function fails, so the admin cannot pause multiple pairs in one transaction; however, individual pairs can still be paused, so no funds are at risk.
What the attacker needed
Caller must be the circuit breaker address
The fix
The fix is to initialize the _updatedAddresses array with the correct length before the loop.
How it was found
- Call globalPause with any valid address.
- The transaction will FAULT.
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 a smart contract bug where a function tries to return a list of addresses but never creates the list first. When someone calls it, the transaction fails because it tries to write to a list that doesn't exist. The function is meant to pause many contracts at once, but because it fails, the admin has to pause each one separately.
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.