Insecure Reentrancy Protection Using Transient Storage
Insecure codeblock
The modifier checks slot 1
for the lock (tload(1)
), but sets the lock in slot 0
(tstore(0, 1))
.
Since slot 1
is never updated, the lock check (if tload(1))
always passes , rendering the guard useless.
Functions like sendETH
or contractInteractions
can be re-entered during external calls (e.g., call{value: ...}), allowing attackers to drain funds.
Transient Storage can also be overwritten by a separate contract, causing unforeseen issues.
A successful reentrancy attack can lead to:
Fund Drainage: An attacker can repeatedly withdraw funds from the contract, exceeding the intended limits.
State Corruption: Critical state variables can be manipulated, leading to unpredictable behavior and potential denial-of-service.
Exploitation of Other Vulnerabilities: Reentrancy can be used as a stepping stone to exploit other vulnerabilities in the contract.
Note: This was discovered after researching using a variety of llms, and a search of online articles. As such I personally am not an expert in understanding memory slots
Use openzepplin reentrancy guard, instead of a custom modifier
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.