The StabilityPool contract contains a critical access control vulnerability where the Deployer role maintains excessive control over critical protocol functions. This centralized control could allow unauthorized modifications to oracle configurations, fee whitelists, and owner permissions, potentially destabilizing the protocol.
The Deployer role has unrestricted access to modify:
Oracle configurations
Fee whitelists
Owner permissions
Manager allocations
Market configurations
This control is implemented through the onlyOwner
modifier and direct access to critical functions:
The vulnerability stems from the contract's inheritance of OwnableUpgradeable
, which grants the Deployer role unrestricted administrative privileges. While this is common in development phases, the planned transition to production without proper access control delegation creates a significant security risk.
The impact of this vulnerability could be severe:
Protocol Instability:
Arbitrary changes to fee structures
Potential manipulation of manager permission
Financial Risks:
Potential theft of protocol funds
Market manipulation through fee modifications
Disruption of lending operations
Static Analysis: Slither
Code Review: Manual analysis of access control patterns
Testing Framework: Hardhat
Here's a test demonstrating the vulnerability using Hardhat:
Test Output:
The planned transition to Timelock controller is the correct approach. Additional recommendations:
Implement Timelock Controller:
Deploy Timelock controller contract
Transfer ownership from Deployer to Timelock
Set appropriate delay periods for critical actions
Access Control Improvements:
Implement role-based access control
Add multi-signature requirements for critical functions
Remove direct Deployer access to sensitive operations
This vulnerability requires immediate attention before production deployment to prevent potential protocol exploitation.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.