During filling an order, the current version of the protocol is not verified to match the version of the protocol when the order was created.
Suppose Alice creates an off-chain order. Before this order is filled, the protocol (or any branch) is upgraded. Then the Alice's off-chain order will be filled in the new version of the protocol. But, maybe it is not desirable for Alice because she is not happy with new configuration of the newly-upgraded protocol. She already signed the off-chain order based on the old configuration/structure of the protocol not the new one.
The root cause of this issue is that the version is not included during verification of off-chain order.
https://github.com/Cyfrin/2024-07-zaros/blob/main/src/perpetuals/branches/SettlementBranch.sol#L240
The same scenario could be possible for on-chain orders, where the users creates a market order, but the protocol upgrades before this order is filled. It does not check that the order was created in older version of the protocol.
Lack of version verification during filling orders.
Following is recommended for off-chain orders (similar modification could be used for on-chain orders):
https://github.com/Cyfrin/2024-07-zaros/blob/main/src/perpetuals/leaves/OffchainOrder.sol#L16
https://github.com/Cyfrin/2024-07-zaros/blob/main/src/perpetuals/branches/SettlementBranch.sol#L240
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.