The SablierV2Lockup::updateMetadata
modifier emits an event at the end of the function:
The SablierV2Lockup::withdraw
function uses the updateMetadata
modifier. However, there are two external calls at the end of the withdraw
function that a malicious user can exploit to gas bomb the function, preventing the MetadataUpdate
event from being emitted due to insufficient gas.
The MetadataUpdate
event is crucial for NFT marketplaces to update metadata. A malicious user can exploit this by consuming 63/64 of the remaining gas in the callback functions, effectively preventing the MetadataUpdate
event from being emitted. This can lead to buyers purchasing streams with outdated and misleading information.
let's assume that there is a stream with status Settled
(Settled status - All assets have been streamed; recipient is due to withdraw them.)
The SablierV2NFTDescriptor
expresses the status of the stream through SablierV2NFTDescriptor::vars.status
. When an attacker withdraws all funds from their stream using the SablierV2Lockup::withdrawMax
function, the stream status changes to Depleted
status (Depleted stream; all assets have been withdrawn and/or refunded.)
However, if the event is never emitted, the NFT status will temporarily still display as Settled
, which could lead a buyer to purchase a stream based on misleading information, opening opportunities for attackers to scam.
Additionally, the two external calls in the SablierV2Lockup::withdraw
function do not include a gas limit, allowing the first call to consume enough gas to prevent the second call from occurring.
If the MetadataUpdate
event is not emitted, it might lead to users purchasing NFTs with misleading information, causing financial losses.
Manual Review
emit the MetadataUpdate
event before the external calls.
Set a gas limit for the first external call to ensure it does not prevent the second call from being executed.
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.