Security Upgrades to harden Protocol Security#385
Security Upgrades to harden Protocol Security#385pankajjagtapp wants to merge 27 commits intomasterfrom
Conversation
…drawRequestNFT contracts
…thdraw functions; enforce invalidation rules for finalized requests
…nd permissionless claims while paused
…s-execute-task yash/feat/permissionless-execute-task
| } | ||
|
|
||
| function executeTasks(IEtherFiOracle.OracleReport calldata _report) external { | ||
| if (!roleRegistry.hasRole(ETHERFI_ORACLE_EXECUTOR_TASK_MANAGER_ROLE, msg.sender)) revert IncorrectRole(); |
There was a problem hiding this comment.
Removed access control enables MEV sandwich attacks on rebases
High Severity
Removing the ETHERFI_ORACLE_EXECUTOR_TASK_MANAGER_ROLE check from executeTasks makes it callable by any address. While report data is still consensus-validated, the caller now controls the exact timing of rebases and protocol fee payments. Since _handleAccruedRewards triggers membershipManager.rebase() which changes the eETH exchange rate via liquidityPool.rebase(), a MEV searcher can sandwich the call: buy eETH, call executeTasks to trigger a positive rebase, then sell eETH at the now-higher rate. Previously the role-gated executor made timing manipulation impractical. This contradicts the PR's stated goal of hardening protocol security.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 1b934ff. Configure here.
📊 Forge Coverage ReportGenerated by workflow run #697 |
…idityPool is paused; add tests for permissionless claims
…guard feat: Reentrancy Guard and permissonless claim
yash/feat/pausable-until
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6db9c1a. Configure here.
| _; | ||
| function _requireNotPaused() internal override view { | ||
| _requireNotPausedUntil(); | ||
| super._requireNotPaused(); |
There was a problem hiding this comment.
Timed pause blocks full pause escalation in OZ-based contracts
Medium Severity
Overriding _requireNotPaused() to call _requireNotPausedUntil() causes OZ's internal _pause() (which uses whenNotPaused) to revert while a timed pause is active. This prevents escalating from a pauseContractUntil to a permanent pauseContract — the PROTOCOL_PAUSER must first call unpauseContractUntil, creating a brief unpaused window. This is inconsistent with LiquidityPool, WithdrawRequestNFT, PriorityWithdrawalQueue, etc., which add the check in the whenNotPaused modifier instead and CAN escalate freely.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 6db9c1a. Configure here.


Note
High Risk
High risk because it changes pause semantics and access control across core protocol contracts, and modifies withdrawal/claim paths and reentrancy protections that directly impact fund movement.
Overview
Introduces a new time-bounded pause mechanism via
PausableUntil(namespaced storage, max 1 day + per-pauser cooldown) and addsPAUSE_UNTIL_ROLE/UNPAUSE_UNTIL_ROLEtoRoleRegistry, wiringpauseContractUntil()/unpauseContractUntil()into multiple contracts and ensuringwhenNotPausedchecks also block during a timed pause.Hardens fund-movement surfaces with a new
ReentrancyGuardNamespaced(upgrade-safe storage slot) and appliesnonReentranttoLiquidityPooldeposit/withdraw/request flows andWithdrawRequestNFTclaim paths;WithdrawRequestNFT.invalidateRequestis also restricted to non-finalized requests.Adjusts operational access control:
Liquifiermigrates from internal admin/pauser mappings toRoleRegistryroles (addsLIQUIFIER_ADMIN_ROLE/LIQUIFIER_SENDER_ROLEand constructor arg), andEtherFiAdmin.executeTasksbecomes permissionless once oracle consensus/freshness checks pass. Withdrawal claims are made more resilient during pauses by allowing permissionless claim paths (WithdrawRequestNFT/PriorityWithdrawalQueue) to proceed even when theLiquidityPoolis paused, andPriorityWithdrawalQueueclaim functions no longer requirewhenNotPaused.Reviewed by Cursor Bugbot for commit 6db9c1a. Bugbot is set up for automated code reviews on this repo. Configure here.