You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Fuel node has configurations for its chain and peer to peer that lack overflow checks on some parameters provided by node operators. Rather than allow a misconfigured node to continue to operate in the event of an overflow, invalid configurations should be validated upfront and rejected by using checked arithmetic.
Figure 42.1: Potential overflow in ChainConfig (audit-fuel/fuel-core/crates/chain-config/src/config/chain.rs#74–78)
Figure 42.2: Potential overflow in P2P configuration (audit-fuel/fuel-core/crates/services/p2p/src/p2p_service.rs#154–171)
pubfn new(config:Config,codec:Codec) -> Self{let local_peer_id = PeerId::from(config.keypair.public());let gossipsub_data =
GossipsubData::with_topics(GossipsubTopics::new(&config.network_name));let network_metadata = NetworkMetadata{ gossipsub_data };// configure and build P2P Servicelet(transport, connection_state) = build_transport(&config);let behaviour = FuelBehaviour::new(&config, codec.clone());let total_connections = {// Reserved nodes do not count against the configured peer input/output
limits.};let total_peers =
config.max_peers_connected + config.reserved_nodes.len()asu32;
total_peers * config.max_connections_per_peer
Exploit Scenario
A node operator uses invalid configurations that cause an overflow. Rather than receiving an error that these configurations are invalid, the node continues to run with unanticipated behavior.
Recommendations
Short term, use checked arithmetic and validate that configurations are within reasonable bounds.
Long term, consider setting Clippy’s integer arithmetic lint to deny and use checked, saturating, or wrapping arimhetic explicitly (same as #1334).
The text was updated successfully, but these errors were encountered:
Closes#1335
Handling overflows during arithmetic operations by denying
`clippy::arithmetic_side_effects`.
Also, it is the last issue that we plan to fix right now in the scope of
the ToB audit report. So this PR closesFuelLabs/fuel-vm#513.
---------
Co-authored-by: Brandon Kite <brandonkite92@gmail.com>
ClosesFuelLabs/fuel-core#1335
Handling overflows during arithmetic operations by denying
`clippy::arithmetic_side_effects`.
Also, it is the last issue that we plan to fix right now in the scope of
the ToB audit report. So this PR closesFuelLabs/fuel-vm#513.
---------
Co-authored-by: Brandon Kite <brandonkite92@gmail.com>
Description
The Fuel node has configurations for its chain and peer to peer that lack overflow checks on some parameters provided by node operators. Rather than allow a misconfigured node to continue to operate in the event of an overflow, invalid configurations should be validated upfront and rejected by using checked arithmetic.
Figure 42.1: Potential overflow in ChainConfig (audit-fuel/fuel-core/crates/chain-config/src/config/chain.rs#74–78)
Figure 42.2: Potential overflow in P2P configuration (audit-fuel/fuel-core/crates/services/p2p/src/p2p_service.rs#154–171)
Exploit Scenario
A node operator uses invalid configurations that cause an overflow. Rather than receiving an error that these configurations are invalid, the node continues to run with unanticipated behavior.
Recommendations
Short term, use checked arithmetic and validate that configurations are within reasonable bounds.
Long term, consider setting Clippy’s integer arithmetic lint to deny and use checked, saturating, or wrapping arimhetic explicitly (same as #1334).
The text was updated successfully, but these errors were encountered: