Open sherlock-admin4 opened 6 months ago
The protocol team fixed this issue in the following PRs/commits: https://github.com/napierfi/napier-uups-adapters/pull/11
An edge case in the proposed fix was found: _stake()
reverts if totalTVL
is greater than maxDepositTVL
. It has been fixed in new PR: https://github.com/napierfi/napier-uups-adapters/pull/22
The Lead Senior Watson signed off on the fix.
Ironsidesec
medium
Missing stake limit validation on
RenzoAdapter._stake
Summary
Every
_stake
function in adapter contracts likeRsETHAdapter
,PufETHAdapter
, andRenzoAdapter
has the below @dev comment to implement the stake limit validation.But only
RsETHAdapter
,PufETHAdapter
validate the stake limits as shown below. ButRenzoAdapter
doesn't validate the stake limit and it reverts in an edge case.https://github.com/sherlock-audit/2024-05-napier-update/blob/c31af59c6399182fd04b40530d79d98632d2bfa7/napier-uups-adapters/src/adapters/puffer/PufETHAdapter.sol#L69-L73
https://github.com/sherlock-audit/2024-05-napier-update/blob/c31af59c6399182fd04b40530d79d98632d2bfa7/napier-uups-adapters/src/adapters/kelp/RsETHAdapter.sol#L71-L75
Vulnerability Detail
RenzoAdapter._stake
callsdepositETH
onRENZO_RESTAKE_MANAGER
https://github.com/sherlock-audit/2024-05-napier-update/blob/c31af59c6399182fd04b40530d79d98632d2bfa7/napier-uups-adapters/src/adapters/renzo/RenzoAdapter.sol#L59
depositETH
line highlighted with>>>
below, it checks theMaxTVLReached
, and it will revert if max TVL is reached. Maybe someone manipulated to cause DOS or unmanipulatedly hit the threshold triggering the revert. And the comment on_stake
says to check the current limit to prevent DOS. ButRenzoAdapter._stake
is missing that.https://etherscan.io/address/0xbaacd5f849024dcc80520baa952f11adfc59f9d0#code#F1#L558 Line 558 on https://etherscan.deth.net/address/0xbaacd5f849024dcc80520baa952f11adfc59f9d0
Impact
DOS or Missing validation the dev intended to make but didn't implement.
Code Snippet
https://github.com/sherlock-audit/2024-05-napier-update/blob/c31af59c6399182fd04b40530d79d98632d2bfa7/napier-uups-adapters/src/adapters/renzo/RenzoAdapter.sol#L59
https://etherscan.io/address/0xbaacd5f849024dcc80520baa952f11adfc59f9d0#code#F1#L558
Line 558 on https://etherscan.deth.net/address/0xbaacd5f849024dcc80520baa952f11adfc59f9d0
Tool used
Manual Review
Recommendation
https://github.com/sherlock-audit/2024-05-napier-update/blob/c31af59c6399182fd04b40530d79d98632d2bfa7/napier-uups-adapters/src/adapters/renzo/RenzoAdapter.sol#L59