Based on the context, the event NewIndexSubmitted should be emitted every time a new pending index is set.
However, in the current implementation of publishNewIndex(), NewIndexSubmitted is not emitted when at around L233, when an auction is ongoing and not bonded yet.
Considering that as a basketToken holder, getting to know when and how the index is going to be updated is crucial, we mark this issue as a Medium.
We believe that essentially the protocol has made a promise to the basketToken holders that they will get notified 24 hours before any changes happen to their holdings.
Not sending that notification should be considered a major issue, which breaks that promise.
A malicious publisher may take advantage of this and rug the basketToken holders by setting an unfair new index.
Handle
WatchPug
Vulnerability details
Based on the context, the event
NewIndexSubmitted
should be emitted every time a new pending index is set.However, in the current implementation of
publishNewIndex()
,NewIndexSubmitted
is not emitted when at around L233, when an auction is ongoing and not bonded yet.Considering that as a basketToken holder, getting to know when and how the index is going to be updated is crucial, we mark this issue as a Medium.
We believe that essentially the protocol has made a promise to the basketToken holders that they will get notified 24 hours before any changes happen to their holdings.
Not sending that notification should be considered a major issue, which breaks that promise.
A malicious publisher may take advantage of this and rug the basketToken holders by setting an unfair new index.
https://github.com/code-423n4/2021-12-defiprotocol/blob/205d3766044171e325df6a8bf2e79b37856eece1/contracts/contracts/Basket.sol#L216-L244
Recommendation
Change to: