Closed c4-submissions closed 1 year ago
Inadequate elaboration.
raymondfam marked the issue as low quality report
raymondfam marked the issue as primary issue
raymondfam marked the issue as duplicate of #115
gzeon-c4 marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-09-centrifuge/blob/512e7a71ebd9ae76384f837204216f26380c9f91/src/util/Factory.sol#L114
Vulnerability details
Impact
Detailed description of the impact of this finding. This call is executed following another call within the same transaction. It is possible that the call never gets executed if a prior call fails permanently. This might be caused intentionally by a malicious callee. The vulnerability is in the factory contract within the newTrancheToken function.
Gas Exhaustion Vulnerability: Smart contracts on the Ethereum blockchain rely on gas to execute transactions and contract functions. Attackers can craft transactions that consume an excessive amount of gas, either by executing complex computations or through recursive calls. This results in a high transaction fee, making it costly for users to interact with the contract or even preventing them from doing so.
External Contract Calls Vulnerability: Contracts may rely on external data or interact with other contracts. If an external contract is compromised or becomes unavailable, it can lead to a DoS condition.
Proof of Concept
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept. Vulnerable Code
Test Case Foundry
Exploit Foundry
Log
Tools Used
Foundry. VS Code. Mythx.
Recommended Mitigation Steps
If possible, refactor the code such that each transaction only executes one external call or make sure that all callees can be trusted (i.e. they're part of your own codebase).
Mitigations: Use Trusted Contracts: Only interact with well-audited and trusted contracts. Fallback Mechanisms: Implement fallback mechanisms or time-based fallbacks to handle unresponsive external contracts. Emergency Stop: Consider implementing an emergency stop mechanism that allows contract owners to pause contract functions in case of an emergency.
Gas Limit Monitoring: Developers should monitor the gas consumption of critical contract functions and set appropriate gas limits. Gas Price Monitoring: Keep an eye on the gas prices in the Ethereum network and adjust gas limits accordingly. Limit Loop Iterations: Avoid unbounded loops within contract functions to prevent gas exhaustion.
Assessed type
DoS