Security mailing lists by PureSourceCode

RUSTSEC-2026-0172

MEDIUM

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::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.

Published
5 Jun 2026
Last modified
17 Jul 2026
Weakness
CWE-416
Also known as
GHSA-ggxf-9f6j-w742
Sources
OSV GHSA-ggxf-9f6j-w742JSONOSVJSON

Scores

SourceScored byVersionScoreVector / decision
OSV GitHub CVSS 4.0 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
OSV crates.io diesel < 2.3.10 2.3.10
OSV crates.io diesel >= 0.0.0-0, < 2.3.10 2.3.10

References

History

  • 25 Nov 2026 20:14 UTC · OSV: first stored (published 5 Jun 2026)
  • 25 Nov 2026 20:14 UTC · OSV: first stored (published 16 Jul 2026)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.