# Malicious validators will bypass consensus threshold requirements affecting the integrity of the SEDA protocol's cross-chain data verification system

Secp256k1ProverV1.postBatch counts duplicate validator signatures toward voting power, letting a single low-power validator approve malicious batches.

- Payout: Audit contest
- Severity: high
- Program: Seda Protocol
- Found by: 0x0x0xw3
- Disclosed: 2024-12-20
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2024-12-seda-protocol-judging/issues/62
- Library page: https://bugbountylibrary.com/r/sherlock%3A2024-12-seda-protocol%3AH-2
- Tags: area:web3 domain:web3 impact:funds-loss impact:integrity kind:contest platform:sherlock sev:high tech:solidity technique:source-review vuln:access-control vuln:business-logic

**Target:** Secp256k1ProverV1 smart contract postBatch function
**Root cause:** The loop over validatorProofs accumulates votingPower without tracking which signers have already contributed, so the same validator's proof and signature can be repeated to inflate voting power.
**Steps:**
1. Identify a validator with any voting power (e.g., 0.25% of total).
2. Compute duplicates needed: ceil(66_670_000 / validatorPower).
3. Sign a malicious batchId with the validator's key.
4. Build arrays `signatures` and `validatorProofs` with the same entry repeated duplicatesNeeded times.
5. Call `postBatch(newBatch, signatures, duplicatedProofs)`; each iteration passes `_verifyValidatorProof` and `_verifySignature`, and votingPower sums to >= threshold.
6. Batch is approved and `BatchPosted` emitted despite only one distinct validator.
**How found:** Code review of the postBatch loop revealed no deduplication of validator signers before summing votingPower.
**Exploitation:** A malicious validator submits a batch with their own signature and proof duplicated enough times to reach the 66.67% consensus threshold, causing the contract to accept fraudulent batches and update the validator set.
**Escalation:** Once batch posting is controlled, attacker can post fraudulent data results and update the validator set with malicious entries, potentially stealing funds from dependent contracts.
**Insight:** When a contract sums voting power from a caller-supplied array of proofs, always check for duplicate signers; the threshold check is meaningless without per-validator uniqueness.

## Proof of concept (copied exactly from the original report)

**Command to run the exploit test**

```
npx hardhat test test/prover/Secp256k1ProverV1.test.ts --grep "proves vulnerability scales with validator power percentage"
```

