Ignore and sanitize untrusted MetaAddr peer services #2324
Labels
A-network
Area: Network protocol updates or fixes
A-rust
Area: Updates to Rust code
C-security
Category: Security issues
I-invalid-data
Zebra relies on invalid or untrusted data, or sends invalid data
Motivation
We have a higher level of trust in peer services that we learn directly from the peer itself.
But if we learn those services from other peers, we don't trust them very much, so we might want to:
Specifications
https://developer.bitcoin.org/reference/p2p_networking.html#addr
(The bitcoin reference and bitcoin wiki don't say much about services.)
Solution
Refactor
services
field inMetaAddr
optional #2976)Security
impl Ord for MetaAddr
Option<PeerServices>
ordering handlesNone
andSome
comparisons correctlyAlternatives
This change doesn't make any difference to security until Zebra supports multiple service bits.
Even then, this change might not make much difference to security.
Related Work
The
MetaAddrChange
code in PRs #2273 and #2275 already has some untrusted service fields.The text was updated successfully, but these errors were encountered: