# RUSTSEC-2023-0047: impl FromMdbValue for bool is unsound

- Database: RustSec
- Published: 2023-06-26
- Modified: 2023-11-08

## Also published as

- [GHSA-F9G6-FP84-FV92](https://cve.now/GHSA-F9G6-FP84-FV92.md) (GitHub)

## Affected versions

- lmdb-rs (crates.io): all versions

## Description

The implementation of `FromMdbValue` have 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 were included in url above.

## References

- https://crates.io/crates/lmdb-rs
- https://rustsec.org/advisories/RUSTSEC-2023-0047.html
- https://github.com/vhbit/lmdb-rs/issues/67

Page: https://cve.now/RUSTSEC-2023-0047

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
