GHSA-pqpw-89w5-82v5 `simd-json-derive` vulnerable to `MaybeUninit` misuse
Misuse of MaybeUninit in simd-json-derive causes undefined behavior, potentially leading to crashes or arbitrary code execution in release builds.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Not stated
- Victim action needed
- Not needed
- Fix
- Available
What is GHSA-pqpw-89w5-82v5?
GHSA-pqpw-89w5-82v5 is a memory corruption vulnerability in simd-json-derive, published on 14 Oct 2023.
Official description
An invalid use of MaybeUninit::uninit().assume_init() in simd-json-derive's derive macro can cause undefined behavior. The original code used MaybeUninit to avoid initialisation of the struct and then set the fields using ptr::write. The undefined behavior triggered by this misuse of MaybeUninit can lead to invlaid memory access and panics in binaries compiled in release mode (aka simd-json-derive prior to version 0.12 has UB and optimizes into some nonsense)
The version 0.12.0 removes this section of code, avoiding the use of MaybeUninit alltogether.
Which versions are affected by GHSA-pqpw-89w5-82v5?
3 open source packages ship an affected version, including simd-json-derive.
| Package | Affected | Fixed in |
|---|---|---|
simd-json-derive crates.io | All versions | 0.12.0 |
simd-json-derive crates.io | All versions | 0.12.0 |
simd-json-derive crates.io | From 0.0.0-0 | 0.12.0 |
How do I fix GHSA-pqpw-89w5-82v5?
Upgrade simd-json-derive to 0.12.0 or later.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is GHSA-pqpw-89w5-82v5 being exploited?
There is no known exploitation of GHSA-pqpw-89w5-82v5 in the wild and no public exploit code.
Sources
Also known as RUSTSEC-2023-0087.