Network not being able to confirm new transactions (total network shutdown)
Bypassing Staking Requirements
Description
Impact
Bypass stake certificate validation, allowing for non-staking nodes and network take-over
Bypass nodes removal validation, allowing to remove nodes from the network
Note: same impact as reports 33222 and 34252 but a different root cause.
Root Cause
The function validateClosestActiveNodeSignatures counts unique signatures, a single keypair can be used to prepare many different valid signatures of the same object.
Attack Flow
Staking
Malicious node generates a fake JoinRequest with a fake StakingCertificate
It brute-forces StakingCertificate fields to make sure its one of the closest nodes to the hash of the staking certificates. This is easy, as only 1 node is needed to be close.
It creates the full JoinRequest, with multiple different signatures signed by him, instead of signatures from many other nodes.
It calls gossip-join-request
Other nodes receive the join request, and validate it using validateClosestActiveNodeSignatures.
The validation bypasses, as the signatures are valid and different.
The new node joins the network without staking.
Kicking a node
Malicious node generates a fake RemoveCertificate.
It fills it with different signatures signed by him, instead of signatures from many other nodes.
It calls remove-by-app gossip route.
Other nodes receive the certificate, and validate it using validateClosestActiveNodeSignatures.
The validation bypasses, as the signatures are valid and different.
Somehow fix the malleability issue, I'm not sure how without going into libSodium.
Severity
This allows to take over the network (by kicking nodes / adding nodes) and so it critical.
In addition, this is the same as 33222 and 34252 which were treated as critical.
Proof of Concept
POC
Due to the 2 POCs in 39768 and 39679 I only created a POC to show the signature checking issue, and not the signature counting issue.