statechain: delete-op Value is not committed by the block hash - two blocks differing only in a delete value share one hash and signature set
Report
Summary
MarshalCanonical hashes a set op's value but writes four zero bytes for a delete op, ignoring op.Value entirely. Two statechain blocks differing only in a delete op's value therefore have the identical hash and verify under the same DAO/oracle signature set, so the hash is not a commitment to the full block content. In-node impact is bounded because no code path reads a delete op's value (ApplyOps, validateEpochValue, and validateTransition all ignore it), so this is a hash-identity and auditability break plus an uncommitted-data carrier under signed blocks, not a state forgery.
Impact
- Two different blocks share one hash and one signature set. Any tooling, audit, or external verifier that identifies a block by its hash cannot distinguish them.
- A delete op's value becomes uncommitted data carried under a signed block hash: a signer can sign one delete value while a different value is presented alongside the same hash.
- Practical severity is low: since no in-node code path reads a delete op's value, the differing value cannot change node state today. The risk is to hash identity, auditability, and any future consumer that starts reading delete values.
Reproduction (unit test)
Temporary test in package statechain (run on commit 89a542e, removed afterwards to keep the tree clean):
b1 := &Block{Index: 1, PrevHash: <32 zero bytes hex>, Timestamp: 1700000000,
Ops: []Op{{Action: ActionDelete, Key: "k", Value: `"aaa"`}}}
b2 := &Block{Index: 1, PrevHash: <32 zero bytes hex>, Timestamp: 1700000000,
Ops: []Op{{Action: ActionDelete, Key: "k", Value: `"zzz-completely-different"`}}}
HashBlock(b1) == HashBlock(b2)
// identical hash: 7ec86f3afcf579a3e41aee6905a5135593a0a916405f598bf0e589d1c3e06502
Control: the same two values under ActionSet hash differently, as expected — proving the delete branch is the only difference.
Test output (also attached as a screenshot):
identical hash for different delete values: 7ec86f3afcf579a3e41aee6905a5135593a0a916405f598bf0e589d1c3e06502
control: set-op hashes differ as expected
Root cause (code)
statechain/encoding.go(MarshalCanonical): theActionSetbranch writes the value length plus the value bytes; theelse(delete) branch writesvar zero [4]byteinstead ofop.Value.statechain/crypto.go:12:HashBlockhashes exactly whatMarshalCanonicalproduces, so the hash inherits the omission.statechain/types.go:14-18:Op.Valueisjson.RawMessage— the value exists on the op and is simply not committed for deletes.
Relationship to known tickets
No match was found in the visible portion of the public board. A keyword search for delete returned only XE-4589, XE-6742, XE-4590, and XE-4784 — certificate eviction, lease swap, vote removal, and conflict cleanup respectively, all unrelated. The duplicate check is partial (about 300 of ~757 open tickets are visible, and no separate GitHub-issues search was run for this candidate), so I leave the duplicate decision to triage.
Suggested fix
Commit the delete op's value in MarshalCanonical the same way the set branch does (length-prefixed value bytes), or explicitly hash a domain-separated "no value" marker and reject non-empty delete values at block validation. Note this changes the block hash for any block containing a delete op, so it needs a coordinated rollout.
Environment
- Commit: 89a542e ("release: testnet-0005 quorum withhold fix", 2026-11-10)
- Evidence is a unit test on that commit; no public testnet nodes were involved.
- Attachments: screenshot of the passing test output.
Thread
Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, file a new report that links https://bounty.xe.network/XE-7917 and says what differs; it is read like any other.