-
Notifications
You must be signed in to change notification settings - Fork 0
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
Missing calls to _updateTokenInRegistry
leads to incorrect state of tokens in registry
#1404
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
M-13
primary issue
Highest quality submission among a set of duplicates
🤖_335_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
selected for report
This submission will be included/highlighted in the audit report
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
sufficient quality report
This report is of sufficient quality
Comments
DadeKuma marked the issue as primary issue |
This was referenced May 18, 2024
Closed
Closed
Closed
Closed
This was referenced May 19, 2024
I'm grouping every " |
This was referenced May 20, 2024
DadeKuma marked the issue as sufficient quality report |
true, needs to be fixed |
gzeon-c4 marked the issue as selected for report |
gzeon-c4 marked the issue as satisfactory |
This was referenced Jun 2, 2024
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
M-13
primary issue
Highest quality submission among a set of duplicates
🤖_335_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
selected for report
This submission will be included/highlighted in the audit report
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2024-04-noya/blob/9c79b332eff82011dcfa1e8fd51bad805159d758/contracts/connectors/CurveConnector.sol#L212
https://github.com/code-423n4/2024-04-noya/blob/9c79b332eff82011dcfa1e8fd51bad805159d758/contracts/connectors/MaverickConnector.sol#L137
https://github.com/code-423n4/2024-04-noya/blob/9c79b332eff82011dcfa1e8fd51bad805159d758/contracts/connectors/GearBoxV3.sol#L62
https://github.com/code-423n4/2024-04-noya/blob/9c79b332eff82011dcfa1e8fd51bad805159d758/contracts/connectors/MorphoBlueConnector.sol#L58
https://github.com/code-423n4/2024-04-noya/blob/9c79b332eff82011dcfa1e8fd51bad805159d758/contracts/connectors/PrismaConnector.sol#L75
https://github.com/code-423n4/2024-04-noya/blob/9c79b332eff82011dcfa1e8fd51bad805159d758/contracts/connectors/BalancerConnector.sol#L64
Vulnerability details
Impact
If the _updateTokenInRegistry() function is not called when it should be, the registry may not accurately reflect the current balances of tokens in the connectors leading to incorrect state.
Proof of Concept
_updateTokenInRegistry() is called in different connector contracts functions. The purpose of this function is to update the token registry to reflect the current balance of a specified token. It can add a new token to the registry or remove a token with zero balance.
According to protocol docs:
But such calls are MISSING in various functions of different connectors where liquidity is either added or removed.
CurveConnector.sol::withdrawFromPrisma
MaverickConnector.sol::claimBoostedPositionRewards
GearBoxV3.sol:::executeCommands
MorphoBlueConnector.sol::withdraw: either of the tokens should be updated inside if block
PrismaConnector.sol::addColl
BalancerConnector.sol::openPosition
Tools Used
Manual Review
Recommended Mitigation Steps
Ensure that the
_updateTokenInRegistry()
function is called in all necessary places in the connector contracts. This function should be invoked whenever a token’s balance changes due to operations such as adding or removing liquidity, or performing swaps.Assessed type
Other
The text was updated successfully, but these errors were encountered: