Advisory

RUSTSEC-2023-0075

Also known as: GHSA-r24f-hg58-vfrw

Summary

Unaligned write of u64 on 32-bit and 16-bit platforms

Details

Affected versions allocate memory using the alignment of usize and write data
to it of type u64, without using core::ptr::write_unaligned. In platforms
with sub-64bit alignment for usize (including wasm32 and x86) these writes
are insufficiently aligned some of the time.

If using an ordinary optimized standard library, the bug exhibits Undefined
Behavior so may or may not behave in any sensible way, depending on
optimization settings and hardware and other things. If using a Rust standard
library built with debug assertions enabled, the bug manifests deterministically
in a crash (non-unwinding panic) saying _"ptr::write requires that the pointer
argument is aligned and non-null"_.

No 64-bit platform is impacted by the bug.

The flaw was corrected by allocating with adequately high alignment on all
platforms.

Severity

Not rated by the source.

Dates

Published
2023-12-20 12:00 UTC
Modified
2024-02-10 16:26 UTC

Affected packages and fixes

unsafe-libyaml

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 0.2.10 (semver)

Fixed versions

0.2.10

Fix

  • Fixed version 0.2.10
    cargo update -p unsafe-libyaml --precise 0.2.10

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