Skip to content
OpenAdvisories
Medium GHSA-f9g6-fp84-fv92 RUSTSEC-2023-0047

impl `FromMdbValue` for bool is unsound

Published Jul 19, 2023 · Updated Nov 8, 2023 · Assigned by GHSA

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).

Affected packages

EcosystemPackageAffectedFixedRecord
crates.io lmdb-rs <= 0.7.6 — GHSA-f9g6-fp84-fv92
crates.io lmdb-rs >= 0.0.0-0 — RUSTSEC-2023-0047

References