Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 1.79 KB

M-06.md

File metadata and controls

41 lines (29 loc) · 1.79 KB

Missing pause checks in LRTOracle

Summary

The LRTOracle oracle provides functionality to pause the contract but no restrictions are applied when the contract is in a paused state.

Impact

Similar to the other contracts in the protocol, the LRTOracle contract offers pausing functionality:

https://github.com/code-423n4/2023-11-kelp/blob/f751d7594051c0766c7ecd1e68daeb0661e43ee3/src/LRTOracle.sol#L101-L109

101:     /// @dev Triggers stopped state. Contract must not be paused.
102:     function pause() external onlyLRTManager {
103:         _pause();
104:     }
105: 
106:     /// @dev Returns to normal state. Contract must be paused
107:     function unpause() external onlyLRTAdmin {
108:         _unpause();
109:     }

However, none of the functions in the contract are affected by this pause. There's no difference at all between a paused or non-paused state.

Since this is the main oracle entrypoint, which provides both prices for individual assets and the RSETH token, the missing intention here is to likely block access to these functions when the contract is paused. In an emergency, and in case the contract is paused, consumers of this oracle, internally to the protocol or externally, should be blocked from fetching prices as it may imply there is something wrong with the current data.

Recommendation

Add the whenNotPaused modifier to the functions that provide oracle prices.

-   function getAssetPrice(address asset) public view onlySupportedAsset(asset) returns (uint256) {
+   function getAssetPrice(address asset) public view onlySupportedAsset(asset) whenNotPaused returns (uint256) {
-   function getRSETHPrice() external view returns (uint256 rsETHPrice) {
+   function getRSETHPrice() external view whenNotPaused returns (uint256 rsETHPrice) {