[NCC-E005955-7DU] zebra-network
: Fragile State Transition During Address Book Update
#6672
Closed
zebra-network
: Fragile State Transition During Address Book Update
#6672
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
’sAddressBook
update implementation usesMetaAddrChange
’sapply_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 newMetaAddr
. 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. Thelast_connection_state
records the outcome of local node’s most recentcommunication attempt with this peer:
zebra/zebra-network/src/meta_addr.rs
Lines 785 to 860 in 5a88fe7
Recommendation
Update
apply_to_meta_addr()
to returnNone
when the state transition is invalid, e.g., the request is received out-of-order.Location
zebra-network/src/meta_addr.rs, line 853
The text was updated successfully, but these errors were encountered: