# GHSA-xpp3-xrff-w6rh: rocksdb vulnerable to out-of-bounds read

> An out-of-bounds read in the Rust RocksDB binding allows attackers to read memory or cause crashes when using multiple column families with TTL.

- **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:** 11 May 2022
- **Also known as:** RUSTSEC-2022-0046

## What is GHSA-xpp3-xrff-w6rh?

GHSA-xpp3-xrff-w6rh is a memory corruption vulnerability in rocksdb, published on 11 May 2022. 

### Official description

Affected versions of this crate called the RocksDB C API
`rocksdb_open_column_families_with_ttl()` with a pointer to a single integer
TTL value, but one TTL value for each column family is expected.

This is only relevant when using
`rocksdb::DBWithThreadMode::open_cf_descriptors_with_ttl()` with multiple
column families.

This bug has been fixed in v0.19.0.

## Which versions are affected by GHSA-xpp3-xrff-w6rh?

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


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

## How do I fix GHSA-xpp3-xrff-w6rh?

Upgrade rocksdb to 0.19.0 or later.

## Is GHSA-xpp3-xrff-w6rh being exploited?

There is no known exploitation of GHSA-xpp3-xrff-w6rh in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-xpp3-xrff-w6rh and fix it if it is affected.

What it is: GHSA-xpp3-xrff-w6rh is a memory corruption vulnerability in rocksdb, published on 11 May 2022. 
Exploitation: There is no known exploitation of GHSA-xpp3-xrff-w6rh in the wild and no public exploit code.

Affected packages and fixed versions:
- rocksdb (crates.io): affected all versions; fixed in 0.19.0
- rocksdb (crates.io): affected all versions; fixed in 0.19.0
- rocksdb (crates.io): affected from 0.0.0-0; fixed in 0.19.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-xpp3-xrff-w6rh/ (Markdown: https://insights.sbomify.com/GHSA-xpp3-xrff-w6rh/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-xpp3-xrff-w6rh

---
From sbomify Insights: https://insights.sbomify.com/GHSA-xpp3-xrff-w6rh/
Summaries are generated and may contain mistakes; the official description above is the record.
