{"id":"GHSA-q8x8-jrhj-fh9p","aliases":["GHSA-q8x8-jrhj-fh9p","RUSTSEC-2026-0137"],"related":[],"kind":"vulnerability","state":"published","title":"Diesel: Possible unaligned data access for implementations of `SqliteAggregate`","summary":"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.","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"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.","format":"markdown","source":"ghsa"}],"published":"2026-04-24T12:00:00.000Z","modified":"2026-05-20T07:26:23.800Z","severity":{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"}],"cwes":["CWE-188"],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.3.8"}],"ecosystem":"crates.io","package":"diesel","purl":"pkg:cargo/diesel","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"2.3.8"}],"ecosystem":"crates.io","package":"diesel","purl":"pkg:cargo/diesel","source":"rustsec"}],"references":[{"url":"https://github.com/diesel-rs/diesel/pull/5042","tags":["web"],"sources":["ghsa","rustsec"]},{"url":"https://github.com/diesel-rs/diesel","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2026-0137.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/diesel","tags":["package"],"sources":["rustsec"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-q8x8-jrhj-fh9p","url":"https://github.com/advisories/GHSA-q8x8-jrhj-fh9p","licence":"CC-BY-4.0","modified":"2026-05-20T07:26:23.800Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2026-0137","url":"https://rustsec.org/advisories/RUSTSEC-2026-0137.html","licence":"CC0-1.0","modified":"2026-05-20T07:15:03.921Z"}],"updatedAt":"2026-11-25T22:56:43.352Z"}