RUSTSEC-2020-0068

    Dashboard / Vulnerabilities / RUSTSEC-2020-0068

    RUSTSEC-2020-0068

    Published: 8 Nov 2020Last Modified: 8 Nov 2023

    Summary: Unexpected panic in multihash `from_slice` parsing code

    Details: 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](https://github.com/libp2p/rust-libp2p/blob/7b415d5e7040e45c541f76f2c409e63d4d3249c6/core/src/peer_id.rs#L89)) 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.

    Affected packages

    Package

    Name: multihash

    Purl: pkg:cargo/multihash

    Affected ranges

    Type: SEMVER

    Events:

    Introduced- 0.0.0-0
    Fixed -0.11.3

    Affected versions

    Common Vulnerability Scoring System

    Attack Vector
    Network
    Adjacent
    Local
    Physical
    Privileges Required
    None
    Low
    High
    User Interaction
    None
    Required
    Scope
    Unchanged
    Changed
    Confidentiality
    None
    Low
    High
    Integrity
    None
    Low
    High
    Availability
    None
    Low
    High
    RUSTSEC-2020-0068 | CVE-DB