GHSA-ggxf-9f6j-w742: Diesel has possible use after free when deserializing a SQLite database via `SqliteConnection::deserialize_readonly_database`
Diesel allows loading a SQLite database from a byte buffer, represented as &[u8], at runtime via the SqliteConnection::deserializereadonlydatabase function. In previous versions of Diesel, this buffer was passed directly to libsqlite3.
Published Jul 16, 2026
Affected packages
diesel
- Ecosystem
- Rust (crates.io)
- Affected
- < 2.3.10
- Fixed in
- 2.3.10
- Check
cargo tree -i diesel
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Rust (crates.io) vulnerabilities
All Rust (crates.io) entriesGHSA-m9p2-fxp5-v3fp
Diesel: Command injection in Diesel's implementation of `COPY FROM`/`COPY TO`
medium6.9May 19, 2026GHSA-q8x8-jrhj-fh9p
Diesel: Possible unaligned data access for implementations of `SqliteAggregate`
medium6.3May 19, 2026GHSA-h5x4-m2qf-r4f2
Diesel's SQLite backend has possible UTF-8 corruption
high8.7May 5, 2026GHSA-wq9x-qwcq-mmgf
Diesel vulnerable to Binary Protocol Misinterpretation caused by Truncating or Overflowing Casts
high8.1Aug 23, 2024
