# GHSA-j8cj-hw74-64jv: Hive has Double-free and Use After Free Vulnerabilities

> A double-free and use-after-free vulnerability in the Rust Hive library allows attackers to cause crashes or execute arbitrary code via unsafe API misuse.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Not stated
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 26 Feb 2026
- **Also known as:** RUSTSEC-2026-0029

## What is GHSA-j8cj-hw74-64jv?

GHSA-j8cj-hw74-64jv is an use after free vulnerability in hivex, published on 26 Feb 2026. 

### Official 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.

## Which versions are affected by GHSA-j8cj-hw74-64jv?

3 open source packages ship an affected version, including hivex.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `hivex` | crates.io | From 0.0.0-0 | 0.2.1 |
| `hivex` | crates.io | From 0.2.0 | 0.2.1 |
| `hivex` | crates.io | From 0.2.0 | 0.2.1 |

## How do I fix GHSA-j8cj-hw74-64jv?

Upgrade hivex to 0.2.1 or later.

## Is GHSA-j8cj-hw74-64jv being exploited?

There is no known exploitation of GHSA-j8cj-hw74-64jv in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-j8cj-hw74-64jv and fix it if it is affected.

What it is: GHSA-j8cj-hw74-64jv is an use after free vulnerability in hivex, published on 26 Feb 2026. 
Exploitation: There is no known exploitation of GHSA-j8cj-hw74-64jv in the wild and no public exploit code.

Affected packages and fixed versions:
- hivex (crates.io): affected from 0.0.0-0; fixed in 0.2.1
- hivex (crates.io): affected from 0.2.0; fixed in 0.2.1
- hivex (crates.io): affected from 0.2.0; fixed in 0.2.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-j8cj-hw74-64jv/ (Markdown: https://insights.sbomify.com/GHSA-j8cj-hw74-64jv/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-j8cj-hw74-64jv

---
From sbomify Insights: https://insights.sbomify.com/GHSA-j8cj-hw74-64jv/
Summaries are generated and may contain mistakes; the official description above is the record.
