Advisory

RUSTSEC-2020-0073

Also known as: CVE-2020-35916, GHSA-9wgh-vjj7-7433

Summary

Mutable reference with immutable provenance

Details

A mutable reference to a struct was constructed by dereferencing a pointer
obtained from slice::as_ptr. Instead, slice::as_mut_ptr should have been
called on the mutable slice argument. The former performs an implicit reborrow
as an immutable shared reference which does not allow writing through the
derived pointer.

There is no evidence for miscompilation, exploitable or otherwise, caused by
this bug. [Further investigation on Zulip][Zulip] suggests that the unoptimized
generated LLVM IR does not contain any UB itself, effectively mitigating
further effects.

[Zulip]: https://rust-lang.zulipchat.com/#narrow/stream/146229-wg-secure-code/topic/Implications.20of.20using.20.60slice.3A.3Aas_ptr.60.20for.20mutable.20access/near/216499472

Severity

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

Dates

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

Affected packages and fixes

image

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 0.23.12 (semver)

Fixed versions

0.23.12

Fix

  • Fixed version 0.23.12
    cargo update -p image --precise 0.23.12

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