This repository has been archived by the owner on Jan 19, 2025. It is now read-only.
defsec - Incomplete Topic Processing Due to Continuous Retry on Pagination Error #80
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Medium
A Medium severity issue.
Reward
A payout will be made for this issue
Sponsor Confirmed
The sponsor acknowledged this issue is valid
Will Fix
The sponsor confirmed this issue will be fixed
defsec
Medium
Incomplete Topic Processing Due to Continuous Retry on Pagination Error
Summary
The
SafeApplyFuncOnAllActiveEpochEndingTopics
function continues to the next iteration when failing to get IDs of active topics, potentially causing an infinite loop or skipping all topics.Vulnerability Detail
In the current implementation, when
k.GetIdsOfActiveTopics()
fails, the function logs a warning and continues to the next iteration of the main loop. This behavior can lead to repeated failures and potentially skip processing all topics.Description:
The problematic code section is:
This
continue
statement causes the function to retry getting the same page of topic IDs indefinitely if there's a persistent error, without moving to the next page or terminating the loop.Impact
Code Snippet
topic_rewards.go#L75
Tool used
Manual Review
Recommendation
Change the
continue
statement tobreak
when failing to get IDs of active topics:The text was updated successfully, but these errors were encountered: