This project might be open to known security vulnerabilities, which can be prevented by tightening the version range of affected dependencies. Find detailed information at the bottom.

Crate libp2p

Dependencies

(38 total, 30 outdated, 1 possibly insecure)

CrateRequiredLatestStatus
 atomic^0.5.00.6.1out of date
 bytes ⚠️^11.11.1maybe insecure
 futures^0.3.10.3.32up to date
 futures-timer^3.0.23.0.3up to date
 getrandom^0.2.30.4.2out of date
 instant^0.1.110.1.13up to date
 lazy_static^1.21.5.0up to date
 libp2p-autonat^0.3.00.15.0out of date
 libp2p-core^0.32.10.43.2out of date
 libp2p-dcutr^0.2.00.14.1out of date
 libp2p-deflate^0.32.00.40.1out of date
 libp2p-dns^0.32.10.44.0out of date
 libp2p-floodsub^0.35.00.47.0out of date
 libp2p-gossipsub^0.37.00.49.3out of date
 libp2p-identify^0.35.00.47.0out of date
 libp2p-kad^0.36.00.48.0out of date
 libp2p-mdns^0.36.00.48.0out of date
 libp2p-metrics^0.5.00.17.0out of date
 libp2p-mplex^0.32.00.43.1out of date
 libp2p-noise^0.35.00.46.1out of date
 libp2p-ping^0.35.00.47.0out of date
 libp2p-plaintext^0.32.00.43.0out of date
 libp2p-pnet^0.22.00.26.0out of date
 libp2p-relay^0.8.00.21.1out of date
 libp2p-rendezvous^0.5.00.17.0out of date
 libp2p-request-response^0.17.00.29.0out of date
 libp2p-swarm^0.35.00.47.1out of date
 libp2p-swarm-derive^0.27.00.35.1out of date
 libp2p-tcp^0.32.00.44.1out of date
 libp2p-uds^0.32.00.43.0out of date
 libp2p-wasm-ext^0.32.00.40.0out of date
 libp2p-websocket^0.34.00.45.1out of date
 libp2p-yamux^0.36.00.47.0out of date
 multiaddr^0.14.00.18.2out of date
 parking_lot^0.12.00.12.5up to date
 pin-project^1.0.01.1.11up to date
 rand^0.7.30.10.0out of date
 smallvec^1.6.11.15.1up to date

Dev dependencies

(5 total, 1 outdated, 1 possibly insecure)

CrateRequiredLatestStatus
 async-std^1.6.21.13.2up to date
 async-trait^0.10.1.89up to date
 env_logger^0.9.00.11.9out of date
 structopt^0.3.210.3.26up to date
 tokio ⚠️^1.151.50.0maybe insecure

Security Vulnerabilities

tokio: reject_remote_clients Configuration corruption

RUSTSEC-2023-0001

On Windows, configuring a named pipe server with pipe_mode will force ServerOptions::reject_remote_clients as false.

This drops any intended explicit configuration for the reject_remote_clients that may have been set as true previously.

The default setting of reject_remote_clients is normally true meaning the default is also overridden as false.

Workarounds

Ensure that pipe_mode is set first after initializing a ServerOptions. For example:

let mut opts = ServerOptions::new();
opts.pipe_mode(PipeMode::Message);
opts.reject_remote_clients(true);

bytes: Integer overflow in `BytesMut::reserve`

RUSTSEC-2026-0007

In the unique reclaim path of BytesMut::reserve, the condition

if v_capacity >= new_cap + offset

uses an unchecked addition. When new_cap + offset overflows usize in release builds, this condition may incorrectly pass, causing self.cap to be set to a value that exceeds the actual allocated capacity. Subsequent APIs such as spare_capacity_mut() then trust this corrupted cap value and may create out-of-bounds slices, leading to UB.

This behavior is observable in release builds (integer overflow wraps), whereas debug builds panic due to overflow checks.

PoC

use bytes::*;

fn main() {
    let mut a = BytesMut::from(&b"hello world"[..]);
    let mut b = a.split_off(5);

    // Ensure b becomes the unique owner of the backing storage
    drop(a);

    // Trigger overflow in new_cap + offset inside reserve
    b.reserve(usize::MAX - 6);

    // This call relies on the corrupted cap and may cause UB & HBO
    b.put_u8(b'h');
}

Workarounds

Users of BytesMut::reserve are only affected if integer overflow checks are configured to wrap. When integer overflow is configured to panic, this issue does not apply.