# GHSA-36xm-35qq-795w: Exposes reference to non-Sync data to an arbitrary thread

> The inventory crate allows thread-unsafe data to be accessed concurrently, potentially causing race conditions, crashes, or memory corruption in Rust applications.

- **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:** 10 Sep 2023
- **Also known as:** RUSTSEC-2023-0058

## What is GHSA-36xm-35qq-795w?

GHSA-36xm-35qq-795w is a vulnerability in inventory, published on 10 Sep 2023. 

### Official description

Affected versions do not enforce a `Sync` bound on the type of caller-provided
value held in the plugin registry. References to these values are made
accessible to arbitrary threads other than the one that constructed them.

A caller could use this flaw to submit thread-unsafe data into inventory, then
access it as a reference simultaneously from multiple threads.

The flaw was corrected by enforcing that data submitted by the caller into
inventory is `Sync`.

## Which versions are affected by GHSA-36xm-35qq-795w?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `inventory` | crates.io | All versions | 0.2.0 |
| `inventory` | crates.io | All versions | 0.2.0 |
| `inventory` | crates.io | From 0.0.0-0 | 0.2.0 |

## How do I fix GHSA-36xm-35qq-795w?

Upgrade inventory to 0.2.0 or later.

## Is GHSA-36xm-35qq-795w being exploited?

There is no known exploitation of GHSA-36xm-35qq-795w in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-36xm-35qq-795w and fix it if it is affected.

What it is: GHSA-36xm-35qq-795w is a vulnerability in inventory, published on 10 Sep 2023. 
Exploitation: There is no known exploitation of GHSA-36xm-35qq-795w in the wild and no public exploit code.

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

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-36xm-35qq-795w/ (Markdown: https://insights.sbomify.com/GHSA-36xm-35qq-795w/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-36xm-35qq-795w

---
From sbomify Insights: https://insights.sbomify.com/GHSA-36xm-35qq-795w/
Summaries are generated and may contain mistakes; the official description above is the record.
