HistoryEditJSON (OSV)

RUSTSEC-2026-0029

Double-free and use-after-free for Hive

Reported
Issued
Package
hivex (crates.io)
Type
INFO Unsound
Keywords
#double-free #use-after-free #undefined-behavior
References
Patched
  • >=0.2.1
Affected Functions
Version
hivex::Hive::close
  • =0.2.0
hivex::Hive::from_handle
  • =0.2.0

Description

Drop implementation for Hive did perform free, but so did Hive::close, which, at the end of the scope performed Drop, therefore triggering double-free.

Additionally, function Hive::from_handle was not marked as unsafe, making it, in combination with as_handle easy to clone and trigger double-free in safe code or triggering UB when using invalid pointer.

Advisory available under CC0-1.0 license.