Sun::setSoilBelowPeg
is a crucial function that is invoked each season to peg Beans. However, it utilizes all the whitelisted well LP tokens. Currently, only one token is on this list, but more can be added in the future (hence the use of a loop). The addition process employs WhitelistFacet::whitelistToken
and allows the owner to add new accepted Well tokens to the silo. The issue is that there's no check for the maximum number of tokens or maximum price in whitelistToken
or setSoilBelowPeg
. It will lead to denial of service for one of two reasons:
Too many token to handle: results in out of gas
The price for all tokens will overflow in the SafeAdd Librairy.
Likelyhood: Very low
Only one token is currently present, and it could take several months/years before the bug manifests.
Impact: High
It leads to a denial of service for the entire pegging system of Beanstalk.
Implement a limit for whitelisted well tokens in the contract and check if adding all the prices won't cause a revert before adding a token.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.