Closed sherlock-admin2 closed 10 months ago
1 comment(s) were left on this issue during the judging contest.
auditsea commented:
It's protocol decision, and not affecting the protocol
1 comment(s) were left on this issue during the judging contest.
auditsea commented:
It's protocol decision, and not affecting the protocol
Invalid, admin are trusted entities, so this would constitute malicious admin not valid based on sherlock rules see point 5.
0xmystery
medium
Users could run into DoS when calling collectRedemption() due to increased change of redemptionDelayBlocks
Summary
A potential vulnerability has been identified in the smart contract handling the redemption process of collateral in the Ubiquity Pool system. The issue arises from the ability of contract administrators to change
poolStorage.redemptionDelayBlocks
, potentially affecting users who have already initiated a redemption but have not yet collected their collateral.Much as the admin is trusted, there isn't a way to prevent the incidents from happening unless
poolStorage.unclaimedPoolCollateral[collateralIndex] ==0
.Vulnerability Detail
LibUbiquityPool.sol
separates the redemption process into two functions:redeemDollar()
andcollectRedemption()
. Users first callredeemDollar()
to initiate the redemption, and after a delay defined bypoolStorage.redemptionDelayBlocks
, they callcollectRedemption()
to complete the process. However, ifpoolStorage.redemptionDelayBlocks
is increased after a user has calledredeemDollar()
but beforecollectRedemption()
, it could extend the waiting period unexpectedly, effectively causing a Denial of Service for the user.Impact
The impact of this vulnerability is primarily on the user experience, potentially causing delays in the redemption process. It could erode trust in the system if users perceive that the delay period can be arbitrarily extended.
Code Snippet
https://github.com/sherlock-audit/2023-12-ubiquity/blob/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol#L485-L492
https://github.com/sherlock-audit/2023-12-ubiquity/blob/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol#L788-L796
Tool used
Manual Review
Recommendation
To mitigate this vulnerability, it is recommended to cache the
poolStorage.redemptionDelayBlocks
value at the time of callingredeemDollar()
. This can be achieved by adding a new mapping in theUbiquityPoolStorage
struct that records the redemption delay for each user at the time they initiate redemption. ThecollectRedemption()
function should then refer to this user-specific delay rather than the global setting. This approach ensures that any changes to the global redemption delay do not affect users who have already initiated the redemption process.Implementation example:
This change would safeguard the redemption process against unexpected delays, enhancing trust and reliability in the smart contract's operations.