Critical Security Mistakes Blockchain Engineers Make
A single bug in blockchain infrastructure can compromise an entire network. These mistakes have caused chain splits, fund losses, and network outages. Learn from them.
Consensus Mistakes
Errors in consensus implementation.
Nondeterministic state transitions
Using operations that produce different results on different machines: floating point, unordered maps, system time.
Incorrect fork choice implementation
Fork choice rule that does not match specification or has edge case bugs.
Finality gadget bugs
Marking blocks as final when they are not, or not finalizing when they should be.
Slashing condition errors
Not slashing validators who violate rules, or slashing innocent validators.
P2P Network Mistakes
Peer-to-peer networking vulnerabilities.
Trusting peer data without verification
Accepting blocks, transactions, or state from peers without cryptographic verification.
Eclipse attack vulnerability
Node can be surrounded by attacker peers, isolated from honest network.
Insufficient DoS protection
Not rate limiting messages, not validating before heavy processing.
Message amplification vulnerabilities
Small request triggers large response, enabling DDoS amplification.
Cryptographic Mistakes
Errors in cryptographic implementation.
Rolling your own cryptography
Implementing cryptographic primitives instead of using audited libraries.
Non-constant-time secret operations
Operations involving secrets that take variable time based on secret values.
Weak random number generation
Using non-cryptographic RNG for key generation or protocol randomness.
Private key exposure in logs or errors
Accidentally logging private keys or including them in error messages.
State Management Mistakes
Errors in state storage and sync.
State root calculation differences
Different clients computing different state roots for same transactions.
Unsafe database operations
Not handling database errors, crashes, or corruption properly.
Pruning too aggressively
Removing historical data that is still needed for reorgs or validation.
State sync without verification
Downloading state from peers and using it without checking proofs.
Operations Mistakes
Errors in node operations and deployment.
Exposing admin RPC publicly
Admin APIs (send transactions, control node) accessible without auth.
Validator keys on hot machine
Storing validator signing keys on internet-connected machine.
No monitoring or alerting
Running nodes without visibility into their health or behavior.
Untested upgrade procedure
Upgrading nodes without testing the procedure in staging.
Protocol Implementation Mistakes
Errors when implementing protocol specifications.
Spec interpretation differences
Ambiguous spec language interpreted differently between clients.
Missing protocol versioning
No way to identify or negotiate protocol version between peers.
Incorrect serialization
Encoding/decoding that differs from specification or other clients.
Gas metering inconsistencies
Gas costs for operations that differ from specification.
Missing bounds checks
Not validating that values fit within expected ranges.
Memory and Resource Mistakes
Resource management vulnerabilities.
Unbounded memory allocation
Allocating memory based on peer-provided sizes without limits.
Resource leaks
Not cleaning up connections, file handles, or memory.
Blocking the event loop
Long-running operations blocking critical network handling.
Insufficient connection limits
No cap on peer connections allowing resource exhaustion.
Cache poisoning
Allowing attackers to fill caches with useless data.
Testing and Validation Mistakes
Quality assurance errors.
No fuzzing
Not using fuzz testing on parsers and state transitions.
Insufficient cross-client testing
Not testing against other implementations before release.
Missing regression tests
Not adding tests for previously found bugs.
Key Recommendations
Profile before optimizing. Intuition about performance bottlenecks is often wrong.
Test consensus changes with network simulations, not just unit tests.
Monitor peer connections and block propagation in production, not just availability.
