Unbounded iteration over all indexes (2)
The smart contract iterates over an array of indexes without a bound, so if the array grows too large, transactions will consume more gas than the block limit and fail. This could cause a denial of service for core functionality.
Submitted by Dravee, also found by robee, egjlmn1, danb, WatchPug, Fitraldys, and Ruhum
The transactions could fail if the array get too big and the transaction would consume more gas than the block limit. This will then result in a denial of service for the desired functionality and break core functionality.
Proof of Concept
https://github.com/code-423n4/2022-01-insure/blob/main/contracts/PoolTemplate.sol#L703
Tools Used
VS Code
Recommended Mitigation Steps
Keep the array size small.
Upgrading to sev-2 as this will eventually affect the availability of the protocol as transactions revert.
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
This could cause a denial of service for the affected functionality and break core protocol operations as transactions revert.
What the attacker needed
Array grows large enough
The fix
The array size should be kept small to prevent gas costs from exceeding the block limit.
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 has a list of items and a function that goes through every item each time it is called. If the list becomes very long, the function uses too much gas (the fee for computation) and the transaction fails, so users cannot use that function.
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.