-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seed Gauge System Codehawks Remediations #819
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit 8107521.
pizzaman1337
reviewed
Apr 8, 2024
hellofromguy
changed the title
Bip39 seed gauge remediations
Seed Gauge System Codehawks Remediations
Apr 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Seed Gauge System Codehawks Changes
Contest link: https://www.codehawks.com/report/clsxlpte900074r5et7x6kh96
Codehawks Remediations
stalkIssuedPerBdv
if whitelisting a dewhitelisted asset. (f5bda85)defaultGaugePointFunction
to return the currentgaugePoints
if the optimal and currentdepositedBDV
are within bounds. (49cdd76)CHAINLINK_TIMEOUT
from 4 hours to 1.5 hours. (4255cf1)Other Contract Changes
gm
call in the first available block to 250 beans. (fc905c7)enrootDeposits
to correctly emit ERC-1155 events. (7b98fe1) (see.EnrootFacet
,TokenSilo
,LibSilo
)Misc. changes
Accepted Risks from Codehawks Findings
M-06. [M] DOS in LibChainlinkOracle when not considering phaseId.
This occurs when the Chainlink oracle updates their phaseAggergator. This has occurred 6 times in the lifetime of the ETH/USD oracle. When a change occurs, Beanstalk will not be able to determine a TWAP for the season, causing a 1 Season DoS. In order to determine the next
roundId
to query when a phase a phaseAggergator change occurs, Beanstalk needs to be able to calllatestRound()
on the phase aggregator, which contains access control and thus can only be called by specific contracts. This is an acceptable edge case due to the infrequency of this occurring.L-01. LibEthUsdOracle returning wrong price on minAnswer, impacting fertilizer minting
The
minAnswer
of the ETH/USD oracle is1
, which given the decimals precision of 8, means that Ether would need to be lower than1-e8
dollars in order to effect the protocol. This seems unlikely and unworthy of implementing logic to account for the edge case.L-02. No validation of total supply of unripe beans & Lp in percentBeansRecapped & percentLPRecapped
In the case that all Unripe assets are Chopped/Converted, users would not be able to Convert between Unripe assets. Given that this would only occur when all assets are chopped, it seems preferable to accept this edge case instead of introducing new logic that may be exploitable.