# GHSA-F9G6-FP84-FV92: impl FromMdbValue for bool is unsound

- Database: GitHub
- Severity: medium (stated by ghsa, no CVSS score)
- Published: 2023-07-19
- Modified: 2023-11-08

## Also published as

- [RUSTSEC-2023-0047](https://cve.now/RUSTSEC-2023-0047.md) (RustSec)

## Affected versions

- lmdb-rs (crates.io): through 0.7.6

## Description

The implementation of `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](https://github.com/vhbit/lmdb-rs/issues/67).

## References

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

Page: https://cve.now/GHSA-F9G6-FP84-FV92

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