-
Notifications
You must be signed in to change notification settings - Fork 5
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
xiaoming90 - Withdrawal can be blocked #89
Comments
1 comment(s) were left on this issue during the judging contest. takarez commented:
|
Indeed, such DoS is possible but it would not be a permanent DoS, given the DoS is not permanent as long as there are deposits again. We can prevent such a long-time DoS, like a month, by setting |
Escalate
|
You've created a valid escalation! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
1 - Setting targetBufferPercentage to 100% doesn't solve the issue, it removes the main functionality of the protocol which is yield generating, to solve this issue properly there should be a mechanism that handles withdrawals in a queue. So I believe this is a High |
As mentioned in the report, the deposits by others will not mitigate the issue entirely:
Suppose the protocol team decides to set the |
Following is the Sherlock's judging rules:
The first requirement is met, as shown in the report. For the second requirement, withdrawal is a time-sensitive function of any protocol as it involves the need for someone to withdraw their assets. When we speak of not time-sensitive functions, it means those functions, such as depositing, fetching/retrieving information, or distributing reward tokens. Thus, the second requirement is also met. Thus, the issue is considered to be of high severity. |
This issue should stay High. Lead Watson has shown very well how with minimal effort(in terms of time and cost) can DoS an important function of the protocol. Regarding the rules on whether withdrawal is a time-sensitive function for me, it is time-sensitive. This is one of the most important rules of any DeFi protocol. Everyone should be able to withdraw their funds whenever they want. |
The protocol can be sunset by setting Planning to accept the escalation and consider it a Medium severity issue. |
This is the main functionality of the protocol, without this functionality protocol doesn't have any usecace, how it's a non-critical function, actually this can't be fix for this issue. |
@Czar102 Migration means the protocol's contracts have to be upgraded. The ability to upgrade or migrate should not be used to reduce the severity of an issue during an audit. The risk rating should be based on the context that the in-scope contracts are immutable. Also, it is quite a serious issue if the entire protocol has to be sunsetted to solve this issue. Protocol itself is the critical feature. If you are referring to only sunsetting the protocol's affected adaptor, the adaptor is also a critical feature of the protocol as it manages all interactions with external money markets and the core earning mechanism in the protocol. Without the adaptor, the protocol is broken. |
If the admins behave correctly, the impact of this issue is that the protocol needs to be sunset, but no funds are lost or locked (anymore).
I'm not considering an upgrade here. The impact of "protocol can't fulfill its purpose but doesn't lose funds" is clearly a Medium severity one based on the docs. I maintain my position, but planning to consult this judgment with team members. |
The protocol team fixed this issue in PR/commit https://github.com/napierfi/napier-v1/pull/180. |
Result: |
Escalations have been resolved successfully! Escalation status:
|
This is a duplicate of previously raised #120, so will be closing this issue and marking it a duplicate. |
The Lead Senior Watson signed off on the fix. |
xiaoming90
high
Withdrawal can be blocked
Summary
Malicious users can block withdrawal, preventing protocol users from withdrawing their funds.
Vulnerability Detail
When the adaptor does not have sufficient buffer ETH, users cannot redeem their PT tokens from the Tranche. It will need to wait for the buffer to be refilled.
https://github.com/sherlock-audit/2024-01-napier/blob/main/napier-v1/src/adapters/BaseLSTAdapter.sol#L156
Let's assume the following:
targetBufferPercentage
is set to 10%Bob (malicious user) could use the following formula to solve for "Deposit" variable OR perform off-chain simulation to determine the right number of assets to deposit for the attack:
Bob deposits 10 ETH. It will become 100 ETH (10 ETH buffer + 90 staked ETH), and the total supply will increase to 100 shares. Bob will receive 10 shares in return after the deposit.
Bob redeems his 10 shares, and the adaptor will send him 10 ETH, which depletes the entire amount of ETH buffer within the adaptor. Since there is no fee charged during deposit and withdraw on the adaptor, Bob will not lose any of the initial 10 ETH.
Since malicious Bob has depleted the ETH buffer, the rest of the Napier users cannot withdraw.
Bob will perform the above attacks within a single transaction to DOS Napier users, preventing them from withdrawing. The users can only withdraw when the rebalancer bot unstake the staked ETH to replenish the buffer. However, the issue is that in the worst-case scenario, it will take 5 days for the redemption to be processed before the adaptor can start claiming the ETH from LIDO.
Following is the withdrawal period (waiting time) for unstaking ETH:
Note that the deposits by other users will not mitigate this issue due to the following reasons:
prefundedDeposit
andprefundedRedeem
functions to carry out this attack as they are still accessible after maturity.Impact
Users are unable to withdraw. This attack is cheap to execute (gas fee would be a few bucks), but the negative consequence to the protocol is significant (e.g., block withdrawal for 5 days). To DOS Napier for a month, one could execute the attack 6 times every 5 days, and the total costs are still cheap for the attacker, short traders, or competitors (other protocols).
Marking this as a High issue as the impact is High and probability is High (due to ease of execution and cheap to execute)
Code Snippet
https://github.com/sherlock-audit/2024-01-napier/blob/main/napier-v1/src/adapters/BaseLSTAdapter.sol#L156
Tool used
Manual Review
Recommendation
Consider any of the following measures to mitigate the issues:
prefundedDeposit
andprefundedRedeem
function only to the Tranche. This does not entirely prevent this attack, but it makes the attack more expensive due to the issuance fee charged during the deposit when performed via Tranche.Duplicate of #120
The text was updated successfully, but these errors were encountered: