Closed c4-submissions closed 1 year ago
0xA5DF marked the issue as duplicate of #879
0xA5DF marked the issue as sufficient quality report
0xA5DF marked the issue as low quality report
alcueca marked the issue as unsatisfactory: Out of scope
No proof of impact, overinflated severity, bot race already alerting of reentrancy possibilities.
Lines of code
https://github.com/code-423n4/2023-09-maia/blob/f5ba4de628836b2a29f9b5fff59499690008c463/src/BranchPort.sol#L167-L185 https://github.com/code-423n4/2023-09-maia/blob/f5ba4de628836b2a29f9b5fff59499690008c463/src/BranchPort.sol#L188-L219
Vulnerability details
Impact
In a Re-entrancy attack, a malicious contract calls back into the calling contract before the first invocation of the function is finished. This may cause the different invocations of the function to interact in undesirable ways, especially in cases where the function is updating state variables after the external calls. This may lead to loss of funds, improper value updates, token loss, etc.
Proof of Concept
The replenishReserves function is vulnerable to reentrancy
The replenishReserves function is vulnerable to reentrancy
Tools Used
VS Code.
Recommended Mitigation Steps
It is recommended to add a Re-entrancy Guard to the functions making external calls. The functions should use a Checks-Effects-Interactions pattern. The external calls should be executed at the end of the function and all the state-changing must happen before the call.
Assessed type
Reentrancy