Closed code423n4 closed 1 year ago
https://github.com/code-423n4/2022-11-redactedcartel/blob/main/src/vaults/AutoPxGmx.sol#L315 https://github.com/code-423n4/2022-11-redactedcartel/blob/main/src/vaults/AutoPxGmx.sol#L339 https://github.com/code-423n4/2022-11-redactedcartel/blob/main/src/PirexGmx.sol#L824
A reentrancy attack could be performed and can result in exploit and losing funds
https://github.com/code-423n4/2022-11-redactedcartel/blob/main/src/vaults/AutoPxGmx.sol#L339 https://github.com/code-423n4/2022-11-redactedcartel/blob/main/src/vaults/AutoPxGmx.sol#L315 https://github.com/code-423n4/2022-11-redactedcartel/blob/main/src/PirexGmx.sol#L824
Manual review
Use nonReentrant modifier imported from solmate/utils/ReentrancyGuard.sol
nonReentrant
solmate/utils/ReentrancyGuard.sol
Picodes marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2022-11-redactedcartel/blob/main/src/vaults/AutoPxGmx.sol#L315 https://github.com/code-423n4/2022-11-redactedcartel/blob/main/src/vaults/AutoPxGmx.sol#L339 https://github.com/code-423n4/2022-11-redactedcartel/blob/main/src/PirexGmx.sol#L824
Vulnerability details
Impact
A reentrancy attack could be performed and can result in exploit and losing funds
Proof of Concept
https://github.com/code-423n4/2022-11-redactedcartel/blob/main/src/vaults/AutoPxGmx.sol#L339 https://github.com/code-423n4/2022-11-redactedcartel/blob/main/src/vaults/AutoPxGmx.sol#L315 https://github.com/code-423n4/2022-11-redactedcartel/blob/main/src/PirexGmx.sol#L824
Tools Used
Manual review
Recommended Mitigation Steps
Use
nonReentrant
modifier imported fromsolmate/utils/ReentrancyGuard.sol