GHSA-f9g6-fp84-fv92: Lmdb rs Impl `FromMdbValue` For Bool Is Vulnerability

MODERATE
Published
Advisory Summary

GHSA-f9g6-fp84-fv92 is a MODERATE impl `frommdbvalue` for bool is vulnerability (General Security Weakness) affecting Lmdb rs libraries in the crates.io ecosystem. The issue involves impl `frommdbvalue` for bool is unsound. Remediation is available in the latest vendor maintenance releases.

GHSA-f9g6-fp84-fv92 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-f9g6-fp84-fv92
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Lmdb rs
Package Ecosystem crates.io
Published Date
Last Updated

How to Fix GHSA-f9g6-fp84-fv92

To remediate this vulnerability, upgrade all affected Lmdb rs dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

lmdb-rs fixed: Latest secure release
Upgrade lmdb-rs to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for lmdb-rs

How to Check if You Are Affected

To determine whether your application is affected by GHSA-f9g6-fp84-fv92, inspect your project dependencies for Lmdb rs:

inspect dependencies for lmdb-rs

Analyze the terminal output to locate any version of Lmdb rs in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Lmdb rs, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

GHSA-f9g6-fp84-fv92 Affected Lmdb rs Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
lmdb-rs
crates.io
≤ 0.7.6

References

Frequently Asked Questions

What is GHSA-f9g6-fp84-fv92?
GHSA-f9g6-fp84-fv92 is a security vulnerability in Lmdb rs involving impl `FromMdbValue` for bool is unsound under General Security Weakness.
Which Lmdb rs versions are affected?
Affected versions include releases prior to current release patches across affected packages: lmdb-rs.
What version fixes GHSA-f9g6-fp84-fv92?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is lmdb-rs affected?
Yes, lmdb-rs is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-f9g6-fp84-fv92?
GHSA-f9g6-fp84-fv92 is classified under General Security Weakness.
How can I check crates.io dependencies for GHSA-f9g6-fp84-fv92?
Run the dependency tree command: 'inspect dependencies for lmdb-rs'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f9g6-fp84-fv92",
  "modified" : "2023-07-19T22:09:38Z",
  "published" : "2023-07-19T22:09:38Z",
  "aliases" : [ ],
  "summary" : "impl `FromMdbValue` for bool is unsound",
  "details" : "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).\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "lmdb-rs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.7.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/vhbit/lmdb-rs/issues/67"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/vhbit/lmdb-rs"
  }, {
    "type" : "WEB",
    "url" : "https://rustsec.org/advisories/RUSTSEC-2023-0047.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-19T22:09:38Z",
    "nvd_published_at" : null
  }
}