The runBlueprint
modifier in the TractorFacet
contract contains a vulnerability due to improper nonce handling. Specifically, the current implementation only checks that the nonce is below a maximum value but does not ensure the nonce's uniqueness or sequential order. This weakness can lead to replay or out-of-order execution attacks.
See the following code:
The runBlueprint modifier performs the following checks and actions:
Ensures the current nonce is less than the maximum nonce allowed for the blueprint.
Checks the blueprint's validity period based on the current block timestamp.
Increments the nonce associated with the blueprint hash.
Sets and resets the blueprint publisher.
The issue lies in the nonce check: it only verifies that the nonce is below a maximum value but does not ensure that the nonce is unique or sequential. This can allow for the following attacks:
An attacker can reuse an old nonce that has not reached the maximum value yet.
An attacker can use nonces out of order, potentially disrupting the sequence of operations.
Reusing an old nonce can lead to the same operation being executed multiple times, potentially causing financial losses or operational disruptions. Executing operations out of order can lead to inconsistencies and unexpected behavior in the contract's state.
Manual Review
To prevent replay and out-of-order execution attacks, the contract should ensure that nonces are both unique and sequential.
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.