GHSA-ggxf-9f6j-w742: Diesel :deserialize_readonly_database` Vulnerability
MODERATEGHSA-ggxf-9f6j-w742 is a MODERATE :deserialize_readonly_database` vulnerability (CWE-416: Use After Free) affecting Diesel libraries in the crates.io ecosystem. The issue involves :deserialize_readonly_database`. Remediation is available by upgrading affected packages to version 2.3.10.
GHSA-ggxf-9f6j-w742 at a Glance
How to Fix GHSA-ggxf-9f6j-w742
To remediate this vulnerability, upgrade all affected Diesel dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade diesel to 2.3.10
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for diesel
How to Check if You Are Affected
To determine whether your application is affected by GHSA-ggxf-9f6j-w742, inspect your project dependencies for Diesel:
inspect dependencies for diesel
Analyze the terminal output to locate any version of Diesel in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.10), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-416: Use After Free, where the product reuses or references memory after it has been freed. at some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer. In Diesel, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-ggxf-9f6j-w742 Affected Diesel Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
diesel
|
crates.io |
< 2.3.10
|
2.3.10
|
References
Frequently Asked Questions
What is GHSA-ggxf-9f6j-w742?
Which Diesel versions are affected?
What version fixes GHSA-ggxf-9f6j-w742?
Is diesel affected?
What CWE is associated with GHSA-ggxf-9f6j-w742?
How can I check crates.io dependencies for GHSA-ggxf-9f6j-w742?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-ggxf-9f6j-w742",
"modified" : "2026-07-16T19:25:25Z",
"published" : "2026-07-16T19:25:25Z",
"aliases" : [ ],
"summary" : "Diesel has possible use after free when deserializing a SQLite database via `SqliteConnection::deserialize_readonly_database`",
"details" : "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.\n\nThis vulnerability affects users of `SqliteConnection::deserialize_readonly_database` who drop the buffer passed to the function before they drop the database connection.\n\n## Mitigation\n\nThe 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.\n\n## Resolution\n\nDiesel 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.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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" : [ {
"package" : {
"ecosystem" : "crates.io",
"name" : "diesel"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.3.10"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/diesel-rs/diesel/commit/1bc2ea46d9840e8d9af844239d3c84f37fe7d84b"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/diesel-rs/diesel"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2026-0172.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-416" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-07-16T19:25:25Z",
"nvd_published_at" : null
}
}