Vulnerability CriticalRUSTSEC-2019-0014 · image
RUSTSEC-2019-0014: Flaw in interface may drop uninitialized instance of arbitrary types
Short answerA security vulnerability in the image crate: Flaw in interface may drop uninitialized instance of arbitrary types. Critical severity (CVSS 9.8). Fixed in 0.21.3: update to a fixed version.
| Crate | image |
|---|---|
| Type | Vulnerability |
| Affected versions | From 0.10.2 before 0.21.3. |
| Fixed in | 0.21.3 |
| Severity | Critical, CVSS 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| Published | 2019-08-21 |
| Last changed | 2023-11-08 |
| Also known as | CVE-2019-16138, GHSA-m2pf-hprp-3vqm |
| Affected functions | image::hdr::HDRDecoder::read_image_transform |
What to do
- See which version you have:
cargo tree -i image(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p image. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for exampleimage = "0.21.3") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
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.
References
- Package: crates.io/crates/image
- Advisory: rustsec.org/advisories/RUSTSEC-2019-0014.html
- Web: github.com/image-rs/image/pull/985
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Other advisories for image
Up next
Same crateimage: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?