Commits 2 outstanding change(s) that were sitting uncommitted. No build artifacts and no secrets in the changeset (both checked).
3.7 KiB
Security Fixes Applied - 2025
Summary
This document tracks security-related fixes applied to the Lux node codebase.
Critical Fixes
1. Timer Stoppage Race Fix (2025-11-11)
Reference: SECURITY_STABILITY_AUDIT.md section 2.3
File: /network/throttling/inbound_resource_throttler.go
Issue: Non-blocking timer drain could miss draining channel due to race.
Before (buggy):
if !timer.Stop() {
select {
case <-timer.C:
default: // Could miss drain!
}
}
After (correct):
if !timer.Stop() {
<-timer.C // Blocking ensures drain
}
2. P-Chain Validator Set Race (Verified)
Location: /vms/platformvm/vm.go:367
Status: Already uses validators.NewLockedState(&vm.lock, validatorManager)
3. Sync Work Overlap Prevention (Verified)
Location: /x/sync/manager.go:999-1010
Status: Already checks startEqualsMid || midEqualsEnd to prevent invalid ranges
4. MerkleDB Crash Recovery (Verified)
Location: /x/merkledb/db.go:321-339
Status: Shutdown marker checked BEFORE root initialization (correct order)
5. MerkleDB Cache Eviction (Verified)
Location: /x/merkledb/cache.go
Status: Uses wrappers.Errs for error handling (no panic on eviction)
6. Crypto UnmarshalText Fix (2025-11-11)
Commit: 967b3381c5
File: /crypto/secp256k1/keys.go
Issue: PrivateKey.UnmarshalText incorrectly called UnmarshalJSON. Solution: Created shared unmarshalText() helper for both JSON and Text methods.
7. Reflect Codec Array Type Check (2025-11-11)
Commit: b3babd5092
File: /node/codec/reflectcodec/type_codec.go
Issue: Array marshaling checked wrong type (value.Type() instead of value.Type().Elem()). Solution: Fixed to check element type + added CanAddr() safety check.
8. ProposerVM Goroutine Leak Fix (2025-11-11)
Commit: 60fd0c91db
File: vms/proposervm/scheduler/scheduler.go
Issue: time.After() leaks goroutines on context cancellation. Solution: Replaced time.After with explicit timer + defer timer.Stop()
FHE T-Chain Security (2025-12-28)
Location: vms/mpcvm/fhe/
Security Hardening Applied
- Commitment verification before accepting DKG shares
- Caller authentication on permit creation
- Constant-time comparisons using
crypto/subtle - Nonce/expiry validation to prevent replay attacks
- Lock release before callbacks to prevent deadlocks
Key Commits
a65f8f9ec0 fhe: comprehensive security fixes from CTO swarm review
78e4d51496 security(mpcvm/fhe): fix critical security issues from CTO audit
323877830d fhe: implement proper DKG using lattice multiparty Shamir secret sharing
luxd Security Ports (2025-11-11)
Implemented and Verified (22 improvements)
- ✅ HTTP/2 Connection Reuse Fix (CleanlyCloseBody)
- ✅ RTT Measurement (atomic ping/pong tracking)
- ✅ NetID Caching in ProposerVM (4096-entry LRU)
- ✅ SetPreferenceWithContext (context cancellation respect)
- ✅ Remove MaxContiguousHeight (simplification)
- ✅ GetAllValidatorsAt Endpoint (P-chain RPC)
- ✅ Warp Validator Set Caching (8-entry post-Granite LRU)
- ✅ Warp Validator Set Accessors (consensus package integration)
- ✅ HeightIndex Database Interface
- ✅ GetProposedHeight API (proposervm service)
- ✅ Crypto UnmarshalText Fix
- ✅ Reflect Codec Array Fix
- ✅ HeightIndex In-Memory Implementation
- ✅ ProposerVM Goroutine Leak Fix
- ✅ Genesis Validation Tests
- ✅ Deadlock Detection Tests
- ✅ Timer Stoppage Race Fix
- ✅ P-Chain Validator Set Race Protection
- ✅ Sync Work Overlap Prevention
- ✅ MerkleDB Crash Recovery
- ✅ MerkleDB Cache Eviction Safety
- ✅ Validator Set Historical Diffs
Last Updated: 2025-12-28