Advisory

RUSTSEC-2020-0068

Also known as: CVE-2020-35909, GHSA-h7qh-3h6f-w79p

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) 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.

Severity

High Basis: CVSS v3 score 7.5, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Dates

Published
2020-11-08 12:00 UTC
Modified
2023-11-08 04:03 UTC

Affected packages and fixes

multihash

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 0.11.3 (semver)

Fixed versions

0.11.3

Fix

  • Fixed version 0.11.3
    cargo update -p multihash --precise 0.11.3

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences