Due to missing or insufficient access controls, malicious parties can withdraw some or all Ether from the contract account.
This bug is sometimes caused by unintentionally exposing initialization functions. By wrongly naming a function intended to be a constructor, the constructor code ends up in the runtime byte code and can be called by anyone to re-initialize the contract.
Lines of code
https://github.com/code-423n4/2023-01-numoen/blob/main/src/core/Lendgine.sol#L152
Vulnerability details
Description
Due to missing or insufficient access controls, malicious parties can withdraw some or all Ether from the contract account.
This bug is sometimes caused by unintentionally exposing initialization functions. By wrongly naming a function intended to be a constructor, the constructor code ends up in the runtime byte code and can be called by anyone to re-initialize the contract.
https://swcregistry.io/docs/SWC-105
Impact
Unprotected (external/public) function calls sending Ether/tokens to user-controlled addresses may allow users to withdraw unauthorized funds.
Proof of Concept
Recommended Mitigation Steps
Implement controls so withdrawals can only be triggered by authorized parties or according to the specs of the smart contract system.