#39838 [BC-Critical] Bypass certificate signing validation by double counting signatures due to signature malleability
Was this helpful?
Was this helpful?
Submitted on Feb 8th 2025 at 18:38:00 UTC by @Blockian for
Report ID: #39838
Report Type: Blockchain/DLT
Report severity: Critical
Target: https://github.com/shardeum/shardus-core/tree/bugbounty
Impacts:
Network not being able to confirm new transactions (total network shutdown)
Bypassing Staking Requirements
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 and but a different root cause.
The function validateClosestActiveNodeSignatures
counts unique signatures, a single keypair can be used to prepare many different valid signatures of the same object.
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.
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.
The victim node is kicked from the network.
Count signers and not signatures.
Somehow fix the malleability issue, I'm not sure how without going into libSodium.
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.
The function uses which uses ' which calls which verifies an Ed25591 signature. These signatures are vulnerable to (can be also tested )
This allows to take over the network (by kicking nodes / adding nodes) and so it critical. In addition, this is the same as and which were treated as critical.