GHSA-q8x8-jrhj-fh9p: Diesel Possible Unaligned Data Access For Vulnerability
MODERATEGHSA-q8x8-jrhj-fh9p is a MODERATE possible unaligned data access for vulnerability (CWE-188: Reliance on Data/Memory Layout) affecting Diesel libraries in the crates.io ecosystem. The issue involves possible unaligned data access for implementations of `sqliteaggregate`. Remediation is available by upgrading affected packages to version 2.3.8.
GHSA-q8x8-jrhj-fh9p at a Glance
How to Fix GHSA-q8x8-jrhj-fh9p
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.8
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-q8x8-jrhj-fh9p, 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.8), 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-188: Reliance on Data/Memory Layout, where the product makes invalid assumptions about how protocol data or memory is organized at a lower level, resulting in unintended program behavior. 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-q8x8-jrhj-fh9p Affected Diesel Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
diesel
|
crates.io |
< 2.3.8
|
2.3.8
|
References
Frequently Asked Questions
What is GHSA-q8x8-jrhj-fh9p?
Which Diesel versions are affected?
What version fixes GHSA-q8x8-jrhj-fh9p?
Is diesel affected?
What CWE is associated with GHSA-q8x8-jrhj-fh9p?
How can I check crates.io dependencies for GHSA-q8x8-jrhj-fh9p?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-q8x8-jrhj-fh9p",
"modified" : "2026-05-19T19:39:38Z",
"published" : "2026-05-19T19:39:37Z",
"aliases" : [ ],
"summary" : "Diesel: Possible unaligned data access for implementations of `SqliteAggregate`",
"details" : "Diesel allows to register custom aggregate SQL functions for SQLite via the `SqliteAggregate` interface.\n\nTo store an instance of the custom aggregate processor Diesel relied on the `sqlite3_aggregate_context` function provided by sqlite. This function doesn't provide any guarantees about alignment of the returned allocation, which in turn can lead to problems if the type implementing requires a special alignment, e.g. via a custom `#[align(x)]` attribute on the type implementing this trait. This affects any user of `SqliteAggregate` that registers the custom aggregate function with an SQLite connection, while using a non-standard alignment on the type implementing this trait.\n\n## Mitigation\n\nThe preferred mitigation to the outlined problem is to update to a Diesel version 2.3.8 or newer, which includes fixes for the problem.\n\n## Resolution\n\nDiesel now allocates the corresponding memory on Rust side to get a correctly aligned allocation.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:H/AT:P/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.8"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/diesel-rs/diesel/pull/5042"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/diesel-rs/diesel"
}, {
"type" : "WEB",
"url" : "https://rustsec.org/advisories/RUSTSEC-2026-0137.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-188" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-19T19:39:37Z",
"nvd_published_at" : null
}
}