GHSA-ggxf-9f6j-w742 Diesel allows loading a SQLite database from a byte buffer, represented as `&[u8]`, at runtime via the `SqliteConnection::deserialize_readon
Attackers can trigger use-after-free in Diesel SQLite deserialization if buffers are dropped early, potentially causing crashes or code execution.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Not stated
- Victim action needed
- Not needed
- Fix
- Available
What is GHSA-ggxf-9f6j-w742?
GHSA-ggxf-9f6j-w742 is an use after free vulnerability in diesel, published on 5 Jun 2026.
Official description
Diesel allows loading a SQLite database from a byte buffer, represented as &[u8], at runtime via the SqliteConnection::deserialize_readonly_database function. In previous versions of Diesel, this buffer was passed directly to libsqlite3. Since libsqlite3 requires the buffer to remain alive for as long as the database connection is open and Diesel did not ensure this as part of its safe API, callers of SqliteConnection::deserialize_readonly_database could drop the buffer prematurely. This prematurely drop caused libsqlite3 to operate on freed memory.
This vulnerability affects users of SqliteConnection::deserialize_readonly_database who drop the buffer passed to the function before they drop the database connection.
Mitigation
The preferred mitigation to the outlined problem is to update to Diesel version 2.3.10 or newer, which includes a fix for the problem. Alternatively users need to take to keep the buffer alive until the connection is dropped.
Resolution
Diesel now stores a copy of the buffer inside of the SqliteConnection object itself to keep it alive as long as the underlying libsqlite3 connection exists.
Which versions are affected by GHSA-ggxf-9f6j-w742?
3 open source packages ship an affected version, including diesel.
| Package | Affected | Fixed in |
|---|---|---|
diesel crates.io | All versions | 2.3.10 |
diesel crates.io | All versions | 2.3.10 |
diesel crates.io | From 0.0.0-0 | 2.3.10 |
How do I fix GHSA-ggxf-9f6j-w742?
Upgrade diesel to 2.3.10 or later.
Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.
Is GHSA-ggxf-9f6j-w742 being exploited?
There is no known exploitation of GHSA-ggxf-9f6j-w742 in the wild and no public exploit code.
Sources
Also known as RUSTSEC-2026-0172.