Closed code423n4 closed 1 year ago
141345 marked the issue as primary issue
seems exaggerate, at most QA no significant loss
donosonaumczuk marked the issue as sponsor disputed
It does not apply, we are considering the specific timestamp to be the date where the change takes affect. Also, is not taking into account the context, where the secuirty period is 7 days already.
Picodes changed the severity to QA (Quality Assurance)
Lines of code
https://github.com/code-423n4/2023-07-lens/blob/cdef6ebc6266c44c7068bc1c4c04e12bf0d67ead/contracts/namespaces/LensHandles.sol#L256
Vulnerability details
Impact
function
_hasTokenGuardianEnabled
is using comparison that can be compromised because of it's strict behaviour.Proof of Concept
Here is the highlighted vulnerable code
Possible Scenario How It Can Be Exploited
==
comparison and in result the comparison will not revert if anything malicious happened because there should be a check for Block.timestamp==
comparison. See Reference_By_Bot_Report_Of_This_Contest Here.block.timestamp
to be earlier than the actual current time i.eblock.timestamp < _tokenGuardianDisablingTimestamp[wallet]
. It would evaluate to true even if the token guardian is still supposed to be active. This would allow any attacker to bypass the Guardian MEchanism and perform actions that should have been restricted.!wallet.isContract()
in AND comparison.Tools Used
Manual Review / Static Code Analyzer
Recommended Mitigation Steps
Oracle can be used i.e
chainlink oracle
or usingblock.number
because miners has less control overblock.number
compared to timestampAssessed type
Timing