Open code423n4 opened 1 year ago
bytes032 marked the issue as sufficient quality report
bytes032 marked the issue as high quality report
bytes032 marked the issue as primary issue
witherblock (sponsor) confirmed
This is the opposite discussion to being paused frozen and losing yield
GalloDaSballo changed the severity to QA (Quality Assurance)
Lines of code
https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/perp-vault/PerpetualAtlanticVault.sol#L462-L496 https://github.com/code-423n4/2023-08-dopex/blob/eb4d4a201b3a75dd4bddc74a34e9c42c71d0d12f/contracts/perp-vault/PerpetualAtlanticVault.sol#L502-L524
Vulnerability details
Impact
updateFundingPaymentPointer()
andupdateFunding()
can be called even when the contract is in a paused state. Paused state suggests that there shoudn't be any actions nor changes on the current, paused contract. However, bothupdateFundingPaymentPointer()
andupdateFunding()
changes the state of the contract.Proof of Concept
updateFundingPaymentPointer()
andupdateFunding()
functions do not implement_whenNotPaused()
. Lack of_whenNotPaused()
means that these functions can be called even when the contract is being paused.Import the contract into Remix IDE. Deploy
PerpetualAtlanticVault.sol
. Now runpause()
to pause the contract. While contract is paused, it's still possible to callupdateFundingPaymentPointer()
andupdateFunding()
.Tools Used
Manual code review and Remix IDE.
Recommended Mitigation Steps
Add
_whenNotPaused()
to above functions.Assessed type
Other