The lack of reentrancy protection in the flash loan callback functions (_openCdpCallback, _adjustCdpCallback, _closeCdpCallback) can allow an attacker to reenter the contract during execution, potentially leading to multiple CDP openings, adjustments, closures or other malicious acts.
Look at these part of the LeverageMacroBase.sol contract _openCdpCallback:
The onFlashLoan function in LeverageMacroBase.sol handles the flash loan callback and calls _handleOperation to perform the necessary operations. The _handleOperation function then calls the appropriate callback function (_openCdpCallback, _adjustCdpCallback, or _closeCdpCallback) based on the operation type.
However, the callback functions (_openCdpCallback, _adjustCdpCallback, _closeCdpCallback) do not have explicit reentrancy protection mechanisms such as the nonReentrant modifier. This could potentially allow an attacker to reenter the contract during the execution of these functions and manipulate the state in an unintended way.
Add the nonReentrant modifier to the _openCdpCallback, _adjustCdpCallback, and _closeCdpCallback functions to prevent reentrancy.
