You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ac91e5d
Browse filesBrowse the repository at this point in the historyBrowse files
fix: harden deserialization and message handlers against panics (#4844)
* fix: harden deserialization and message handlers against panics
Replace five panic-prone paths reachable from peer-controlled or untrusted
input with explicit error returns / safe fallbacks:
- action.envelope.LoadProto: return ErrInvalidAct on unknown TxType instead
of panicking on TxType >= 5.
- evm.ExtractRevertMessage: bound-check the Error(string) ABI payload and
reject non-UTF-8 messages; fall back to hex on malformed input.
- evm.StateDBAdapter.AddLog: guard the in-contract-transfer topic check
against empty topics.
- chainservice.Filter / ReportFullness: reject blocks with nil Header or
nil Header.Core before dereferencing Height.
- endorsement.Endorsement.LoadProto: return an error on nil proto instead
of panicking before signature/delegate verification.
Add unit tests covering each new error path.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix: address three HIGH-severity peer-reachable attack vectors
Findings #6, #7, #9 from the security audit, all read-verified:
#6 nodeinfo: HandleNodeInfo dereferenced msg.Info without a nil check, so
any peer could crash a node by broadcasting NODE_INFO with Info=nil.
Now guarded; non-panic test added.
#7 actsync: RequestActionsFromNeighbors had no upper bound on the number
of in-flight requests, letting a peer drown a node in outbound traffic.
Cap added; tests cover cap respected under flood, dedup must not
double-count, concurrent flood respects cap.
#9 server/itx: admin mux (/pause, /unpause, /producer-keys, pprof) was
bound to 0.0.0.0, letting any peer that could reach the admin port halt
block production with an unauthenticated POST to /pause. Now bound to
127.0.0.1.
(Finding #8 — actpool cross-shard eviction — has been moved to a
separate PR for independent review.)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(evm): reject malformed revert payloads instead of silent hex fallback
Change ExtractRevertMessage signature to (string, error) and propagate
the error from ExecuteContract so a tx with a malformed Error(string)
revert payload invalidates the action rather than landing with a junk
hex string in the receipt. erigonstore callers swallow the error with a
local hex fallback since they already return vm.ErrExecutionReverted to
their caller.
Drop the utf8.Valid gate — honest contracts can revert with non-UTF-8
bytes, so rejecting on that would fork the chain on legitimate input.
Added a regression test pinning the non-UTF-8 happy path.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments