GHSA-h7qh-3h6f-w79p

Suggest an improvement
Source
https://github.com/advisories/GHSA-h7qh-3h6f-w79p
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/08/GHSA-h7qh-3h6f-w79p/GHSA-h7qh-3h6f-w79p.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-h7qh-3h6f-w79p
Aliases
Published
2021-08-25T20:49:41Z
Modified
2023-11-08T04:03:38.796770Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
Unexpected panic in multihash
Details

In versions prior 0.11.3 it's possible to make fromslice panic by feeding it certain malformed input. It's never documented that fromslice (and frombytes which wraps it) can panic, and its' return type (Result<Self, DecodeError>) suggests otherwise. In practice, fromslice/from_bytes is frequently used in networking code 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..

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [
        "CWE-20"
    ],
    "severity": "HIGH",
    "github_reviewed": true,
    "github_reviewed_at": "2021-08-19T20:51:29Z"
}
References

Affected packages

crates.io / multihash

Package

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.11.3

Ecosystem specific

{
    "affected_functions": [
        "multihash::digests::MultihashGeneric::from_bytes",
        "multihash::digests::MultihashRefGeneric::from_slice"
    ]
}