You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the identified Yul assembly block, the use of the return opcode causes the execution to stop entirely. This can be problematic if there is code following the assembly block that must execute to maintain the integrity of the protocol or complete the intended logic.
Issue
The return function call terminates the execution abruptly, skipping any instructions after the assembly block.
Premature execution halt might result in skipped essential operations, leading to unintended behaviors.
If critical logic for state updates or validations resides after the assembly block, it will be ignored, potentially causing system inconsistencies or vulnerabilities.
Severity Assessment
Severity: Medium
Likelihood: Moderate
Impact: The skipped logic could lead to state inconsistencies or a failure to execute essential operations.
Proof of Concept (PoC)
Deploy the Unitroller contract with the current code.
Call a function that invokes the Yul block containing return.
Observe that any logic following the Yul block is not executed.
Recommendations
Replace the return opcode with structured Solidity code or ensure that it is used only when appropriate, i.e., at the end of execution paths where no further logic is required.
If assembly is necessary, explicitly manage control flow to avoid unintentional halts.
The text was updated successfully, but these errors were encountered:
Brave Plum Shetland
High
Yul Block Contains return Function Call Causing Premature Execution Halt in Unitroller.sol
Summary
https://github.com/sherlock-audit/2024-12-numa-audit/blob/main/Numa/contracts/lending/Unitroller.sol#L179
The presence of a return function call within a Yul assembly block can prematurely halt execution, preventing subsequent code from being executed. This behavior can lead to unexpected results or potential vulnerabilities if critical logic is skipped.
Vulnerability Details
In the identified Yul assembly block, the use of the return opcode causes the execution to stop entirely. This can be problematic if there is code following the assembly block that must execute to maintain the integrity of the protocol or complete the intended logic.
Issue
The return function call terminates the execution abruptly, skipping any instructions after the assembly block.
Affected Code
Impact
Premature execution halt might result in skipped essential operations, leading to unintended behaviors.
If critical logic for state updates or validations resides after the assembly block, it will be ignored, potentially causing system inconsistencies or vulnerabilities.
Severity Assessment
Severity: Medium
Likelihood: Moderate
Impact: The skipped logic could lead to state inconsistencies or a failure to execute essential operations.
Proof of Concept (PoC)
Deploy the Unitroller contract with the current code.
Call a function that invokes the Yul block containing return.
Observe that any logic following the Yul block is not executed.
Recommendations
Replace the return opcode with structured Solidity code or ensure that it is used only when appropriate, i.e., at the end of execution paths where no further logic is required.
If assembly is necessary, explicitly manage control flow to avoid unintentional halts.
The text was updated successfully, but these errors were encountered: