Skip to content

ExtNetInfo deserialization drops a repeated purpose unvalidated, so mined ProTx netInfo can carry bytes Core never checks #7864

Closed

Description

@shumkov

Summary

ExtNetInfo deserialization reads the purpose map with UnserializeMap, which inserts each pair with m.insert(...) (src/serialize.h:1232-1243). A purpose that appears twice is parsed and then silently dropped: insert keeps the first copy. ExtNetInfo::Validate() (src/evo/netinfo.cpp) iterates only over the resulting m_data, so the dropped copy is never validated.

Its entries can hold bytes that NetInfoEntry::Unserialize tolerates without failing (src/evo/netinfo.h:243-264): an unknown entry type is cleared after its type byte, and an invalid or unreadable service is cleared too. As a result a ProTx whose netInfo is, for example,

version 1 | 2 pairs | [CORE_P2P: <valid entry>] | [CORE_P2P: <entry with type byte 0x03>]

passes IsTriviallyValid and can be mined. The txid covers every byte, including the copy Core never looked at.

Read at develop 0981a582f5 (v24.0.0-rc.3 has the same netinfo.h and providertx.h). This comes from reading the source; I have not reproduced it on a node yet.

Why it matters

  • Third-party parsers. Any parser that decodes netInfo strictly rejects a transaction Core accepts, and with it the whole block. rust-dashcore currently rejects unknown entry types and unknown network ids, so a crafted ProRegTx or ProUpServTx would stop SPV clients and DAPI block streaming at that block. To be safe, every library (rust-dashcore, dashcore-lib, DashSync, dashj, Insight) would have to reproduce Core's exact leniency, including the duplicate drop.
  • Non-canonical payloads. One masternode configuration has many valid serializations, and only the first copy of each purpose means anything.
  • Cheap to fix now. V24 is still NEVER_ACTIVE on mainnet, so the rule can tighten before its parameters are set. Testnet may need care if V24 activates there first.

Suggested fix

Reject a repeated purpose key while deserializing ExtNetInfo, or have Validate() compare the number of pairs read with m_data.size(). Optionally, reject cleared (invalid) entries in every copy, so the accepted byte form of netInfo is canonical.

Found while reviewing ProTx v3 support in rust-dashcore (dashpay/rust-dashcore#1047).

Activity

  1. added 3 commits that reference this issue on Oct 15, 2026
    e5a87d9
    37d31a8
    2186380
  2. added a commit that references this issue on Oct 16, 2026
    fad547f
  3. added 2 commits that reference this issue on Oct 16, 2026
    636b3d1
    ce5dbf3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions