- Reported
-
- Issued
-
- Package
-
libp2p-gossipsub
(crates.io)
- Type
-
Vulnerability
- Categories
-
- Keywords
-
#libp2p
#gossipsub
#panic
#overflow
- Aliases
-
- References
-
- Patched
-
Description
When a peer sent a PRUNE control message, the backoff it asked for was turned into an expiry time with Instant::now() + Duration::from_secs(backoff). That addition panics on overflow, so a peer that sends a PRUNE with a very large backoff, such as u64::MAX, crashes the node. No authentication is needed beyond an ordinary libp2p connection with the gossipsub protocol, and the attacker can repeat it after every restart.
The fix uses Instant::checked_add in BackoffStorage::update_backoff and ignores a backoff that would overflow. It is in 0.49.3.
Advisory available under CC0-1.0
license.