-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AxelarAmplifierGateway
: Malicious signatures remain valid even when malicious signers were rotated out by operators
#18
Comments
The gateway |
The Warden's submission details that a rotation of signers does not retroactively invalidate message approvals. I am inclined to agree with the Sponsor as it would be ineffective to do so due to their ability to be executed immediately (i.e. false sense of security) and consider this submission to be a QA (L) observation. |
alex-ppg changed the severity to QA (Quality Assurance) |
alex-ppg marked the issue as grade-b |
I believe this is still a valid issue. Replying to your comment:
It would be ineffective to do so if the honest signers have to submit transactions to invalidate the submitted malicios messages, but if they become invalid by design immediately after the malicios signers are rotated out, then its not ineffective. For example the Replying to the sponsors comment:
Upgrading the gateway to remove the malicios messages would be leaving the mitigation for after the fact. This would not handle any non-timelock messages that are still valid directly after the malicios signers are rotated out. For timelock messages it would depend on the duration of the timelock. If it's 5 weeks, then yes, maybe it is possible to apply this mitigation, but if it is 5 minutes, then it's obviously not. To stress the importance of this, the contest page explicitly lists this as a place to look for bugs:
This seems to be directly violated, as the validation function incorrectly validates messages from signers that are rotated out. Instead of this being a missing a function to invalidate messages, it can be viewed as a design flaw in which messages from malicios signers that have been rotated out are still executeable. Again, this can be non-trivial to fix, but it seems pretty important that malicios messages should not be executed, so I don't see how this can be a low severity... |
Hey @gesha17, thank you for your PJQA contribution!
The Sponsor meant that it is possible for a malicious signer to sign and immediately execute a transaction in a single payload. This means that it would be impossible for a rotation to be executed in time before a harmful action is done.
Upgrading a contract is never considered an acceptable mitigation, and this submission was evaluated on its original C4-compliant merits.
To "fix" this vulnerability, we would have to remove features that the Axelar Network protocol desires. Given that the incidence of a malicious signer is considered low and an adequate rescue mechanism already exists, I cannot consider any alternatives to the system currently in place as HM vulnerabilities. To re-iterate, a malicious signature may be capitalized on the moment it is created so even if we invalidate signatures after a rotation the harm would have already been done. |
Lines of code
https://github.com/code-423n4/2024-08-axelar-network/blob/main/axelar-gmp-sdk-solidity/contracts/gateway/BaseAmplifierGateway.sol#L174-L188
https://github.com/code-423n4/2024-08-axelar-network/blob/main/axelar-gmp-sdk-solidity/contracts/governance/BaseWeightedMultisig.sol#L125
https://github.com/code-423n4/2024-08-axelar-network/blob/main/axelar-gmp-sdk-solidity/contracts/gateway/AxelarAmplifierGateway.sol#L99-L103
Vulnerability details
Details
The Amplifier Gateway has a mechanism to rotate message signers, that is, to change the current message signers to a new set of signers, the set themselves being signed-off by Axelar. To prevent a malicious signer set from hijacking the Amplifier Gateway, each rotation has an enforced delay.
During emergencies, e.g. when a signer set was determined to have been compromised, a trusted operator role can rotate to a new set of signers while bypassing the rotation delay. The emergency rotation itself requires signatures from Axelar, so said operator has to coordinate with the Axelar team to rotate out the compromised set of signers.
However, signatures that were made by the compromised signer set remains approved without methods to revoke the approval, and said messages will continue to remain valid even after the malicious signers were rotated out.
Vulnerability details
The Axelar Amplifier Gateway has a designated
operator
role that can bypass rotation delays:https://github.com/code-423n4/2024-08-axelar-network/blob/main/axelar-gmp-sdk-solidity/contracts/gateway/AxelarAmplifierGateway.sol#L99-L103
This allows the operator (with a valid signature from Axelar) to rotate out a compromised signer set quickly, as per the NatSpec of said function.
When a signed message is sent from the Axelarnet Gateway to the Amplifier Gateway, the Weighted Multisig checks that the set of signers is sufficiently fresh, only then the message is approved
https://github.com/code-423n4/2024-08-axelar-network/blob/main/axelar-gmp-sdk-solidity/contracts/governance/BaseWeightedMultisig.sol#L125
However, once the message is approved, there is no further check during message validation. Any message that has been approved remains valid throughout its existence. There is also no functionality to invalidate any messages, nor to invalidate a set of signers alongside their messages.
https://github.com/code-423n4/2024-08-axelar-network/blob/main/axelar-gmp-sdk-solidity/contracts/gateway/BaseAmplifierGateway.sol#L174-L188
That means when a set of signers has been determined to be compromised and rotated out by the operators (alongside Axelar Governance), any malicious messages signed and approved remains valid without any methods to revoke the approval. This can compromise the security of e.g. timelocked executions or any messages that relies on permissioned/delayed executions as malicious messages will always be validate-able.
Impact
Any messages that were approved by a malicious signers set remain approved even when the malicious signer set were rotated out, without any methods to un-approve them. This can compromise the security of applications such that receiving messages are non-permissionless or requires a delay (e.g. timelocked executions).
Recommended mitigation
Similar to how operators can bypass the rotation cooldown given a designated signature from Axelar team, operators should also be able to cancel approved messages with another designated signature (or cancelling all messages from a given past epoch altogether).
Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: