Lucene search

K
osvGoogleOSV:RUSTSEC-2020-0068
HistoryNov 08, 2020 - 12:00 p.m.

Unexpected panic in multihash `from_slice` parsing code

2020-11-0812:00:00
Google
osv.dev
5
multihash parsing
unexpected panic
from_slice
from_bytes
dos
networking code
rust-libp2p
untrusted sources
software
decodeerror

EPSS

0.001

Percentile

50.2%

In versions prior 0.11.3 it’s possible to make from_slice panic by feeding it certain malformed input.
It’s never documented that from_slice (and from_bytes which wraps it) can panic, and its’ return type (Result<Self, DecodeError>) suggests otherwise.

In practice, from_slice/from_bytes is frequently used in networking code (for example in rust-libp2p) and is being called with unsanitized data from untrusted sources.
This can allow attackers to cause DoS by causing an unexpected panic in the network client’s code.

EPSS

0.001

Percentile

50.2%

Related for OSV:RUSTSEC-2020-0068