Files
advisory-db/crates/multihash/RUSTSEC-2020-0068.md
2023-06-13 15:10:24 +02:00

1.2 KiB

[advisory]
id = "RUSTSEC-2020-0068"
package = "multihash"
aliases = ["CVE-2020-35909", "GHSA-h7qh-3h6f-w79p"]
cvss = "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
date = "2020-11-08"
url = "https://github.com/multiformats/rust-multihash/pull/72"
categories = ["denial-of-service"]
keywords = ["parsing", "panic", "untrusted data"]

[affected.functions]
"multihash::digests::MultihashRefGeneric::from_slice" = ["< 0.11.3"]
"multihash::digests::MultihashGeneric::from_bytes" = ["< 0.11.3"]

[versions]
patched = [">= 0.11.3"]
unaffected = []

Unexpected panic in multihash from_slice parsing code

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.