GHSA-f9g6-fp84-fv92 impl `FromMdbValue` for bool is unsound
Unsound bool conversion in lmdb-rs allows memory corruption and undefined behavior, potentially leading to code execution or crashes.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Not stated
- Victim action needed
- Not needed
- Fix
- None listed
What is GHSA-f9g6-fp84-fv92?
GHSA-f9g6-fp84-fv92 is a memory corruption vulnerability in lmdb-rs, published on 26 Jun 2023.
Official description
FromMdbValue has several unsoundness issues. First of all, it allows to reinterpret arbitrary bytes as a bool and could make undefined behavior happen with safe function. Secondly, it allows transmuting pointer without taking memory layout into consideration. The details of reproducing the bug are available here.Which versions are affected by GHSA-f9g6-fp84-fv92?
3 open source packages ship an affected version, including lmdb-rs.
| Package | Affected | Fixed in |
|---|---|---|
lmdb-rs crates.io | All versions to 0.7.6 | None |
lmdb-rs crates.io | All versions to 0.7.6 | None |
lmdb-rs crates.io | From 0.0.0-0 | None |
How do I fix GHSA-f9g6-fp84-fv92?
No fix has been published for GHSA-f9g6-fp84-fv92 yet. Limit exposure of the affected software until one is available.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is GHSA-f9g6-fp84-fv92 being exploited?
There is no known exploitation of GHSA-f9g6-fp84-fv92 in the wild and no public exploit code.
Sources
Also known as RUSTSEC-2023-0047.