Missing Minimum Length Check in verifyBatchSignatures Allows Chain Halting Attack
The verifyBatchSignatures function checks only the maximum length of a vote extension, not the minimum, so a malicious validator can submit a vote extension shorter than 65 bytes. This causes a slice out-of-bounds panic during consensus, potentially halting the entire chain.
Source: https://github.com/sherlock-audit/2024-12-seda-protocol-judging/issues/273
Found by
0xHammad, 0xNirix, dod4ufn, g
Summary
Missing validation of minimum vote extension length will cause a chain-halting panic for all network participants as a malicious validator will submit a vote extension smaller than 65 bytes, triggering a slice out-of-bounds panic during consensus.
Root Cause
In verifyBatchSignatures method at https://github.com/sherlock-audit/2024-12-seda-protocol/blob/main/seda-chain/app/abci/handlers.go#L383 , the function checks for maximum length of vote extensions but fails to verify the minimum required length of 65 bytes before attempting to slice the first 65 bytes from the extension:
// Only checks maximum length
if len(voteExtension) > MaxVoteExtensionLength {
h.logger.Error("invalid vote extension length", "len", len(voteExtension))
return ErrInvalidVoteExtensionLength
}
// This line will panic if voteExtension has fewer than 65 bytes
sigPubKey, err := crypto.Ecrecover(batchID, voteExtension[:65])
Internal Pre-conditions
NA
External Pre-conditions
NA
Attack Path
- A malicious validator creates an invalid vote extension with fewer than 65 bytes
- The validator submits this malformed vote extension during the consensus process
- When
verifyBatchSignaturesis called during eitherVerifyVoteExtensionHandlerorProcessProposalHandler, it attempts to accessvoteExtension[:65] - This causes a slice out-of-bounds panic because the slice doesn't have 65 elements
- The panic can halt the entire chain
Impact
The entire blockchain network suffers a complete service interruption. This is a critical denial-of-service vulnerability that a malicious validator can use to bring down all other validators.
PoC
No response
Mitigation
No response
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/sedaprotocol/seda-chain/pull/516
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The function only checks the maximum length of the vote extension and fails to verify that it is at least 65 bytes before slicing the first 65 bytes.
Impact
A malicious validator could cause a complete service interruption, halting the entire blockchain network.
What the attacker needed
Attacker is a validator; Validator submits malformed vote extension
The fix
The issue was fixed by adding a minimum length check before slicing the vote extension.
How it was found
- A malicious validator creates an invalid vote extension with fewer than 65 bytes
- The validator submits this malformed vote extension during the consensus process
- When verifyBatchSignatures is called during either VerifyVoteExtensionHandler or ProcessProposalHandler, it attempts to access voteExtension[:65]
- This causes a slice out-of-bounds panic because the slice doesn't have 65 elements
- The panic can halt the entire chain
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A blockchain relies on validators agreeing on data. One validator can send a specially crafted short message that the code tries to read beyond its length, causing a crash. If enough validators crash, the whole network stops.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.