`updateArtSettings` in `PhiFactory.sol` can still be called even if contract is paused
c4-bot-3 opened this issue · 0 comments
c4-bot-3 commented
Lines of code
Vulnerability details
Vulnerability Details
function updateArtSettings(
uint256 artId_,
string memory url_,
...
...
)
external
onlyArtCreator(artId_)
{
....
....
}updateArtSettings only uses the modifier onlyArtCreator but does not use whenNotPaused. This is dangerous as the main purpose of pausing comes in when an exploit has been discovered.
Since the contract has been compromised and loopholes have been found, updateArtSettings should not be allowed to be called as the compromised contract could have lowered barriers due to a current exploit and may further fall prey to an exploit where illegal parameters are set in updateArtSettings.
Therefore, just like createArt which has whenNotPaused, updateArtSettings should have it as well.
Recommended Mitigation Steps
function updateArtSettings(
uint256 artId_,
string memory url_,
...
...
)
external
onlyArtCreator(artId_)
+ whenNotPaused
{
...
...
}Tools Used
Manual Review, Foundry, VSCode
Assessed type
Access Control