You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unbounded Iteration: The loop iteates up to totalVouches, which is the length of the vouchIds array. There's no inherent limit on how many vouches a profile can receive, so this array can grow very large.
Gas Cost per Iteration: Each iteration of the loop performs several storage reads (accessing vouches, vouch.archived, vouch.balance), calculations (amount.mulDiv), and storage writes vouch.balance += reward
Cumulative Gas Cost - vouchIds array grows cumulative gas cost of the loop increases proportionally. If the total gas cost exceeds the block gas limit, the transaction will fai preventing the distribution of rewards.
Denial-of-Service (DoS) Vector: A malicious actor could create a large number of vouches for a specific profile, making the _rewardPreviousVouchers() function prohibitively expensive to call.
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
No response
PoC
No response
Mitigation
No response
The text was updated successfully, but these errors were encountered:
Lively Banana Gazelle
Medium
Gas Limit Issues in _rewardPreviousVouchers() leads dos
Summary
The function iterates through an array of vouchIds. If this array becomes very large, the loop could consume excessive gas and exceed the block gas limit.https://github.com/sherlock-audit/2024-11-ethos-network-ii/blob/main/ethos/packages/contracts/contracts/ReputationMarket.sol
Root Cause
Unbounded Iteration: The loop iteates up to
totalVouches
, which is the length of the vouchIds array. There's no inherent limit on how many vouches a profile can receive, so this array can grow very large.Gas Cost per Iteration: Each iteration of the loop performs several storage reads (accessing vouches, vouch.archived, vouch.balance), calculations (amount.mulDiv), and storage writes vouch.balance += reward
Cumulative Gas Cost - vouchIds array grows cumulative gas cost of the loop increases proportionally. If the total gas cost exceeds the block gas limit, the transaction will fai preventing the distribution of rewards.
Denial-of-Service (DoS) Vector: A malicious actor could create a large number of vouches for a specific profile, making the _rewardPreviousVouchers() function prohibitively expensive to call.
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
No response
PoC
No response
Mitigation
No response
The text was updated successfully, but these errors were encountered: