medium
impl `FromMdbValue` for bool is unsound
- Severity
- medium rating by GitHub
- Published
- Last changed
- Also known as
- RUSTSEC-2023-0047
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| lmdb-rs (crates.io) | up to 0.7.6, from 0.0.0-0 | GitHub Advisory Database, RustSec Advisory Database |
What each source says
GitHub Advisory Database
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.
RustSec Advisory Database
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
Sources
| Source | Record | Licence |
|---|---|---|
| GitHub Advisory Database | GHSA-f9g6-fp84-fv92 changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2023-0047 changed 2023-11-08 | CC0-1.0 |