RUSTSEC-2019-0014

Source
https://rustsec.org/advisories/RUSTSEC-2019-0014
Import Source
https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2019-0014.json
JSON Data
https://api.osv.dev/v1/vulns/RUSTSEC-2019-0014
Aliases
Published
2019-08-21T12:00:00Z
Modified
2023-11-08T04:01:16.102637Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
Flaw in interface may drop uninitialized instance of arbitrary types
Details

Affected versions of this crate would call Vec::set_len on an uninitialized vector with user-provided type parameter, in an interface of the HDR image format decoder. They would then also call other code that could panic before initializing all instances.

This could run Drop implementations on uninitialized types, equivalent to use-after-free, and allow an attacker arbitrary code execution.

Two different fixes were applied. It is possible to conserve the interface by ensuring proper initialization before calling Vec::set_len. Drop is no longer called in case of panic, though.

Starting from version 0.22, a breaking change to the interface requires callers to pre-allocate the output buffer and pass a mutable slice instead, avoiding all unsafe code.

Database specific
{
    "license": "CC0-1.0"
}
References

Affected packages

crates.io / image

Package

Affected ranges

Type
SEMVER
Events
Introduced
0.10.2
Fixed
0.21.3

Ecosystem specific

{
    "affected_functions": null,
    "affects": {
        "os": [],
        "functions": [
            "image::hdr::HDRDecoder::read_image_transform"
        ],
        "arch": []
    }
}

Database specific

{
    "cvss": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
    "informational": null,
    "categories": []
}