Tadle

Tadle
DeFiFoundry
27,750 USDC
View results
Submission Details
Severity: low
Invalid

Missing whenNotPaused Modifier on Critical Function in PreMarkets.sol

Summary

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.

Vulnerability Details

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.

Impact

  • 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.

Tools Used

Manual Review

Recommendations

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.

function createOffer(/* parameters */) external whenNotPaused {
// Function logic for creating a market offer
}
Updates

Lead Judging Commences

0xnevi Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

[invalid] finding-Rescuable-pause-no-effect

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.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.