[NCC-E005955-7DU] zebra-network
: Fragile State Transition During Address Book Update #6672
Description
Impact
Failure to reject out of order address change requests corrupts the Address Book’s state and opens the Zebra node to state manipulation attacks.
Description
The zebra_network
’s AddressBook
update implementation uses MetaAddrChange
’s apply_to_meta_addr()
to update the entry’s previous state to the received updated state.
The apply_to_meta_addr()
function validates the change against the previous state and optionally returns the new MetaAddr
. If the received state is not the never-attempted state (the else condition on line 831) the current state is one of { AttemptPending
, Responded
, Failed
}. In order to tolerate an address change request that is received out of order, the implementation picks the maximum of { last_response
, last_attempt
, last_failure
} timestamps. Thus these timestamps will never revert to their previous values. However, independent of what the previous state was, on line 853, the new address state is returned. The last_connection_state
records the outcome of local node’s most recent
communication attempt with this peer:
zebra/zebra-network/src/meta_addr.rs
Lines 785 to 860 in 5a88fe7
Recommendation
Update apply_to_meta_addr()
to return None
when the state transition is invalid, e.g., the request is received out-of-order.
Location
Metadata
Assignees
Type
Projects
Status
Done