GHSA-f9g6-fp84-fv92
JSON

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 packageVersionsReported by
lmdb-rs (crates.io)up to 0.7.6, from 0.0.0-0GitHub 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

SourceRecordLicence
GitHub Advisory DatabaseGHSA-f9g6-fp84-fv92 changed 2023-11-08CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2023-0047 changed 2023-11-08CC0-1.0