The PreMarkets.sol
contract inherits from the Rescuable
contract, which provides functionality to pause the contract during emergencies and rescue lost funds. However, the critical createOffer
function in the PreMarkets
contract does not implement the whenNotPaused
modifier, which could lead to security risks during paused states.
The Rescuable
contract is designed to protect the protocol by allowing the contract owner to pause operations during emergencies or when vulnerabilities are detected. This pause functionality is critical to prevent unauthorized or harmful actions during these periods.
However, the PreMarkets
contract's createOffer
function, which is a key function for creating market offers, does not implement the whenNotPaused
modifier. This omission means that the function can still be executed even when the contract is paused, potentially leading to unintended consequences or security breaches.
Security Breach: During a paused state, critical functions like createOffer
should be suspended to prevent any unauthorized actions. If such functions remain active, it can undermine the purpose of pausing the contract, potentially allowing harmful transactions to occur.
Inconsistent Behavior: The lack of a pause check can lead to inconsistencies in the contract's behavior, where some functions are paused, but others, including critical ones, remain active.
Increased Risk During Emergencies: The ability to create new offers during a paused state could be exploited by malicious actors, especially during emergencies or known vulnerabilities.
Manual Review
Add whenNotPaused
Modifier: Implement the whenNotPaused
modifier on the createOffer
function and any other critical functions that should not be executed while the contract is paused.
I believe this is informational and non-acceptable severity because: - A single pause on withdraw to be sufficient to pause the markets during times of emergencies, given that is the only function where collateral/point tokens/native ETH can be pulled from market transactions. - Every tadle market place can be switched offline by the admin via [`updateMarketPlaceStatus`](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/SystemConfig.sol#L160-L171) and is checked in market actions via [`checkMarketPlaceStatus`](https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/libraries/MarketPlaceLibraries.sol#L54-L67) to be online. This prevents many major market actions including the creation, listing and settlement of offers.
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.