GHSA-r24f-hg58-vfrw json
unsafe-libyaml unaligned write of u64 on 32-bit and 16-bit platforms
published 2y ago modified 2mo ago also RUSTSEC-2023-0075
- cvss
- —
- not scored
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- —
- no score, EPSS covers CVEs only
- public exploits
- 0
- none known
Summary
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.
Patch / fix
Is GHSA-r24f-hg58-vfrw in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerAffected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| crates.io | unsafe-libyaml | <0.2.10 >=0.0.0-0, <0.2.10 |
0.2.10 |
References
Sources
- GitHub Advisory GHSA-r24f-hg58-vfrw
- OSV RUSTSEC-2023-0075
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.